firstruby

Master ruby with us

Archive for August, 2010

link_to_remote in Rails 3.x, AJAX link with link_to and :remote => true in rails 3.x

Posted by firstruby on August 8, 2010

In Rails < 3.x,

AJAX link_to_remote code is,

<%= link_to_remote "Click me", :url => update_user_url(user), :method => :put %>

In Rails >= 3.x, AJAX link_to is,

<%= link_to "Click me", user_url(user), :remote => true, :method => :put %>

Posted in Useful Links | Tagged: , , , | Leave a Comment »