hyperrjas
hyperrjas

Reputation: 10744

text_field_tag in simple_form gem

I have this form with simple_form gem

<%= simple_form_for(@post) do |f| %>
  <%= f.error_notification %>

  <div class="form-inputs">
    <%= f.input :title %>
    <%= f.input :description, :as => :text %>
    <%= text_field_tag 'post[tags]' %>
  </div>

  <div class="form-actions">
    <%= f.button :submit %>
  </div>
<% end %>

I want write in simple_form format this line:

<%= text_field_tag 'post[tags]' %>

How can I do it?

Thank you!

Upvotes: 2

Views: 3587

Answers (1)

Mik
Mik

Reputation: 4187

Simple form automatically determines the correct tag, depending on the type of model fields. You can also specify the type of field (as in form_for): f.text_field :tags - simple form support this syntax.

Upvotes: 2

Related Questions