This is a great write up that I thought that I would share 😉
Form helpers are designed to make working with resources much easier compared to plain HTML.
We can use a form builder to create a form within an .erb template. The main form builder for Rails is provided by a helper method called “form_for”. Example code:
The form_for helper creates a form that allows the user to create or update the attributes of a specific model object.
The method can be used in several slightly different ways, depending on how much you wish to rely on Rails to infer automatically from the model how the form should be constructed. For a generic model object, a form can be created by passing form_for a string or symbol representing the object we are concerned with.
In the example above, we are passing in the article object (“:article”).
The variable f yielded to the…
View original post 977 more words