Any instance variables that you define in your controller are automatically propagated to the view, so there is no need to pass them explicitly. This works not only for your initial presentation, but for any partial processing in the process.
You want to send variables :localswhen you call the same partial, but you need to visualize different things that cannot be placed with :objector :collection.
:
<%- @foo = 'example1' %>
<%= render(:partial => 'bar') %>
<%- @foo = 'example2' %>
<%= render(:partial => 'bar') %>
:
<%= render(:partial => 'bar', :locals => { :foo => 'example1' }) %>
<%= render(:partial => 'bar', :locals => { :foo => 'example2' }) %>
, foo @foo. , undefined, , , .