Please log into your user account or create a new one

Solution for: #55: accessing locals hash within an ActionView partial

local_assigns

1
The variable is named "local_assigns," so you can do something like this:

   1  
   2  <% defaults = { :protagonist => 'Romeo', :sidekick => 'Mercutio' } %>
   3  <%= render :partial => "some_other_partial", :locals => defaults.merge(local_assigns) %>


Kind of useful when you have partials wrapping other, very similar partials.