From the documentation for link_to_remote
The result of that request can then be inserted into a DOM object whose id can be specified with options[:update]. Usually, the result would be a partial prepared by the controller with render :partial.
For example, one would do this:
<%= link_to_remote( 'Some link text', :url => url, :method => method, :update => 'name_of_partial' %>
Is there a way to pass a :locals hash to the partial (in the example above, ‘name_of_partial’) similar to when you would render it using ‘render :partial’?
You don’t quite understand. The
:updateargument is the htmlidof the element that will have its contents replaced by the contents of the result of this ajax call.The partial in question is rendered in response to the ajax request in your controller.
The resulting response body is then shoved into your previously named element via the
:updateargument.