Hi can anyone tell when to use form_for and remote_form_for in Ruby on rails.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
remote_form_for is a helper used in rails 2.x (maybe 1.x too) to create a form, that should be submitted via AJAX.
form_foris a rails 3 helper. You can pass it:remote => trueparameter if you want the form to be submitted via AJAX. AFAIK Rails 3.x doesn’t have theremote_form_forhelper anymore.updated
you use form_for to create a form for a resource. Like
form_for Article.new– it will automatically map the form to thepost articles/route.form_tagis used to create general forms.