Difference between form_for and form_tag?
问题 I used this gem in my application, but I'm not sure the difference between the different implementation options for the gem: form_for form_tag with block form_tag without block Can anyone clarify? I understand that form_for is used when you wish to interact with a model, but what about the other two? 回答1: The differences are subtle, but important. form_for is a more advanced tool that yields an object you use to generate your form elements: <% form_for(@foo) do |form| %> <%= form.text_field(