Charlie Bowman wrote:
> I think that is the best answer so far....but that seems to go against
> everything that makes ruby so great.  Something just doesn't feel right
> about creating an object just to say that it's empty.  I guess I should
> ask this on the rails list, but I like this list much better :) , Is is
> possible to add methods to the nil class in only the views?  If so, that
> would be awsome!
>
>
>   
>>> Probably the best thing is to do whatever's necessary in the
>>> controller to make sure the template can coast.  So you could, for
>>> example, put list.items (or whatever) in @items, making sure in
>>> advance that it's an empty array if there aren't any.
>>>       
>
>
> Charlie Bowman
> Programmer
> Castle Branch Inc.
>
>   
Hi Charlie,

I think that David's plan is a good one.  I also think that his answer 
has less to do with Ruby and more to do with the appropriate use of the 
Model-View-Controller framework (if that's the right word).

As I understand it, the role of the controller is to be the setup guy 
for the view.  You really want to have as little significant Ruby code 
as you can in the view, and that's what David's answer is getting at.  
Make the controller ensure that the view has an Array to deal with 
rather than let the view worry about what you've given it.

Hope that helps.

Regards,
Matthew