Reputation: 4234
What are the benefits of using form_for over just writing the form html yourself?
It often seems a lot more complicated if you are using the rails helper tags to write html output.
Upvotes: 0
Views: 363
Reputation: 2614
Form helpers are especially helpful when dealing with resources, and when staying close to rails conventions. They populate a form with a resource's data, abstract away information that would otherwise be hardcoded into the markup (E.G. urls, ids, etc.), and save lots of boilerplate code.
Upvotes: 0
Reputation: 7779
method
attribute based on the object
used: post for create, patch for update.Upvotes: 4