pass the flash object i dont know why but you have to
On Wed, Sep 8, 2010 at 2:12 PM, Anders_P
<anders-TlBSdMGKk75YFVMCzM9+FrNAH6kLmebB@public.gmane.org> wrote:
> Hello!
>
> I''m trying to create a partial for flash messages and render it to
my
> views, but I don''t get it to work. My code looks like this:
>
> # _flash.html.erb
> <% flash.each do |key, value| %>
> <%= content_tag(:div, value, :class => "flash #{key}
body_copy
> box_padding") %>
> <% end %>
>
> And in my views:
> <%= render ''shared/flash'' %>
>
> And I get the the following error:
>
> 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.each
>
> Any help would be greatly appreciated!
>
> // Anders
>
> --
> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to
>
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.