views:

111

answers:

2

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.

A: 

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

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

x1a4
A: 

of course in the controller. Here you create an AJAX snippet that will pull an url you specify from your controller.

generated javascript has no access to any partials b/c it runs on client PC.

and controller decides WHAT to respond to this request. it can render a partial, a template, a text, or anything.

zed_0xff