How can I cache the part obtained via link_to_remote in rails?

I use link_to_remote to pull the dynamic content of a part onto a page. This is basically a long string from the "todo's" database throughout the day.

Since the person goes through and checks them, I want to show the updated list using the completed line.

Currently, I need to click the link_to_remote link again after the item is checked, but he would like to redirect back to the "cached" page, but with one item laid out through.

How to do it?

Here is the main view:

<% @campaigns.each do |campaign| %>
<!--link_to_remote(name, options = {}, html_options = nil)-->

<tr><td>   <%= link_to_remote(campaign.name, :update => "campaign_todo",
        :url => {:action => "campaign_todo",
                 :id => campaign.id 
          }
       ) %>  </td></tr> 


<% end %>
</table>

<div id="campaign_todo">


</div>

I would like when the New / Create actions are executed to return to the page that redirected it there.

- "" , . :

  def create
    @contact_call = ContactCall.new(params[:contact_call])


    if @contact_call.save
      flash[:notice] = "Successfully created contact call."
      redirect_to contact_path(@contact_call.contact_id)
    else
      render :action => 'new'
    end
  end

redirect_to: , , ... . , , .

1) , AJAX, ? 2) CSS, , ""?

+5
3

javascript ERB. , link_to_remote, , , javascript.

/app/views/contact _call/_form.html.erb

/app/views/contact_call/create.js.rjs

page.replace :contact_form, :partial => "contact_call/form", :locals => { :user => @user }
page.visual_effect :highlight, :contact_form

javascript, , , html ( ). .

+1

All Articles