Search code examples
ruby-on-railslabelsimple-form

Rails 4 - Simple Form - how to get rid of the label


I'm trying to figure out how to use simple form without the pre-determined label.

I've tried setting label to false as set out below, but it doesn't stop the label of the attribute ('trl') from appearing beside the collection.

<%= f.input :trl do %>
    <%= f.select :trl, Trl.all.map { |t| [t.title, t.id] }, label: false,  include_blank: false, prompt: 'Select one' %>
    <% end %>

Is there a way to dis-apply the labels in simple form?


Solution

  • try this:

    <%= f.input :trl, label: false do %>
      <%= f.select :trl, Trl.all.map { |t| [t.title, t.id] },include_blank: false, prompt: 'Select one' %>
    <% end %>