How to display partial page on page from rails controller without prototype helpers

I am removing Prototype from my Rails 3 application in exchange for jQuery and trying to figure out how my controller should refresh part of the html page without using this Prototype helper:

page.replace_html( "content", :partial => "day" ) 
+4
source share
1 answer

Since you upgraded to Rails 3, you are doing a great job of dropping the use of RJS. Use AJAX method callbacks to replace. For instance:

Ajax call:

 $.ajax( url: "/things/one", type: "GET", complete: function(response, status) { $('#content').html(response); } ); 

Then in the controller:

 class ThingsController def one respond_to do |format| format.js { render :partial => "day" } end end end 
+11
source

All Articles