Stephen Bannasch
2007-May-17 16:17 UTC
can partial_2 called by partail_1 access partial_1''s locals?
I have partial_2 that renders some links. It is sometimes called
directly with a :locals hash.
I also have partial_1 that renders the top and bottom of some pages
and it is also called with a :locals hash.
I''d like to be able to render partial_2 within partial_1.
This is how partial_1 is called:
<%= render(:partial => ''partial_1'', :locals => {
:authorable_object => @external_otrunk_activity,
:authorable_object_class => ExternalOtrunkActivity,
:all_viewable_objects => @all_viewable_external_otrunk_activities,
:all_editable_objects => @all_editable_external_otrunk_activities }) %>
And within partial_1 I am trying to render partial_2 and pass the
locals that partial_2 needs.
<%= render(:partial => ''partial_2'', :locals => {
:authorable_object_class => authorable_object_class,
:all_viewable_objects => all_viewable_objects,
:all_editable_objects => all_editable_objects }) %>
But the locals for partial_2 appear to be nil.
Is there a way to do this?
Thanks for any help.
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---