Search code examples
ruby-on-railslink-to-remote

How do I use link_to_remote to pass then render a partial in rails?


I want to create several link_to_remote links that are campaign names:

<% @campaigns.each do |campaign| %>
<!--link_to_remote(name, options = {}, html_options = nil)-->
   <%= link_to_remote(campaign, :update => "campaign_todo",
                                :url => %>    
<% end %>

I want the output to update on the page to render a partial, which runs a loop through the values associated with the campaign.

The API docs says this will render a partial, but I'm not clear where the name of the :partial template is passed in, either here or in the controller

Thanks.


Solution

  • The controller would render the partial, according to the docs.

    Usually, the result would be a partial prepared by the controller with render :partial.