I'm new to this but could you do this:

above this put

@items_missing_images = Array.new

and then in your if statement do this

@items_missing_images << item

Chas

On Thu, Nov 6, 2008 at 11:01 PM, Scott Kulik <
[EMAIL PROTECTED]> wrote:

>
> here is some of the code:
>
>    @items_all = Item.find(:all)
>
>    for item in @items_all do
>      if not FileTest.exist?(item.image_name)
>        @items_missing_images += item
>      end
>    end
>
> You have a nil object when you didn't expect it!
> You might have expected an instance of Array.
> The error occurred while evaluating nil.+
>
> at @items_missing_images += item
>
> so...how can i declare an empty array of Items?
>
> i tried declaring @items_missing_images = []
>
> but item is not of type array so this won't work.
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to