Thursday, March 11, 2010

Rails Ajax : form_remote_tag vs. remote_form_for

remote_form_for is used when a form is attached to a resource.
------------------------------------
remote_form_for(@post) do |f|
end

form_remote_tag is used when no need to attach a form to a resource.
----------------------------------
form_remote_tag :url => '/posts' do
= submit_tag 'Save'
end

No comments:

Post a Comment