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.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs