Search code examples
ruby-on-railsformsformtastic

Formtastic f.input automatically adds parent name appear next to it


In my application, lists has_many books and books belong_to a list. I have this form for creating a new book in my rails application:

<div class="formtastic-control">
  <%= semantic_form_for(@book) do |f| %>
    <%= render 'shared/error_messages', object: f.object %>
    <%= f.input :list, :as => :select, :include_blank => false %>
    <%= f.text_field :title, class: 'form-control', placeholder: "Title" %>
    <%= f.text_field :author, class: 'form-control', placeholder: "Author (optional)" %>
    <%= f.submit "Add to library", class: "btn btn-default" %>
  <% end %>
</div>

So the user can select which list they want to add the book to. I'm using formtastic to do that. The whole thing works fine, but I want to get rid of the word "list" which appears next to the select tag:

enter image description here

How can I do that? I know it's trivial, but it pushes the select tag to the right and I don't want it to do that.


Solution

  • I added :label => false and it worked, thanks.