On 5/15/05, Michael Meckler
<mmeckler-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
> I recently added a component to my layout, and when I did, it seemed to
> break the flash[]. I can''t use ''flash'' to pass
anything between actions
> anymore.
>
> I poked around a bit and discovered that when you add a component to your
> layout, Flash#sweep gets called two extra times, once after it renders the
> component, and once... in some place I can''t track down. So even
if I add ''
> flash.keep'' in my component action, it''s all still
cleared by the time it
> gets to the next action.
Replying to my own thread...
I couldn''t find any way to get this to work short of hacking on Rails
itself, so that''s what I did. I added "freeze" and
"unfreeze" methods to
FlashHash, so my layout now looks like this:
<div id="sidebar-a"><div id="newshead">Site
News</div>
<% @flash.freeze %>
<%= render_component :controller => "blog", :action =>
"recent" %>
<% @flash.unfreeze %>
</div>
And now everything works as I would expect it to. I''m not sure if this
was
the "right" way to fix my problem, though.
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails