How to replace the div in Rails 3 using AJAX?
问题 I was trying to replace my div in DOM using RJS. Here is the code i tried, The controller has this method: def change render :update do |page| page.replace(:test_id, :partial => "input",:locals =>{ :type => 'text', :name => 'user[user][contactinfo][city]', :val => "", :size => '244', :placeholder_text => 'Yes it is working...'}) end end The view contains: <div id = "test_id"></div> <%= link_to "AJAX", "/poc/change", :remote => true %> Now I want to replace the div id="test_id" with the