Example Of *Form_for* (New article)

Enter Your Name Here:


conculsion: using form_for instead of form_tag will save your code lines in a model's new method.
you are referencing attributes for the two form helpers as followed:

for form_for:
f.text_field :name, f.text_field :phone, f.text_field.url...etc.

for form_tag:
text_field_tag(:article :name), text_field_tag(:article :phone), text_field_tag(:article :url)...etc.

See an example of (form_tag)

Back