[Ruby] About form_with form.〇〇

less than 1 minute read

About ##form_with form.

There was something I didn’t know about form.with form.○, so I’ll put it together as a memorandum.

form.text_field

``


<%= form.text_field :title %>

An input field with a width of 20 characters is set

form.text_area

``


<%= form.text_area :content %>

40x20 input field is set

form.email_filed

<%= form.email.field :email %>

If @ is not included in the posted content, it will not be considered as an email address and an error will occur. Be careful when testing!

There are many other things, but this time there was an error during the test in the input field of the email, so I summarized it as a memorandum.

Tags: ,

Updated: