Create a form

suggest change

You can create a form using the form_tag helper

<%= form_tag do %>
  Form contents
<% end %>

This creates the following HTML

<form accept-charset="UTF-8" action="/" method="post">
  <input name="utf8" type="hidden" value="&#x2713;" />
  <input name="authenticity_token" type="hidden" value="J7CBxfHalt49OSHp27hblqK20c9PgwJ108nDHX/8Cts=" />
  Form contents
</form>

This form tag has created a hidden input field. This is necessary, because forms cannot be successfully submitted without it.

The second input field, named authenticity_token adds protection against cross-site request forgery.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Form Helpers:
*Create a form

Table Of Contents
38Form Helpers
55CSV