How to edit simple_form to customize fields

0

I would like to know how to edit the form fields with simple_form, edit such with the bootstrap, I read some tutorials but I did not understand how I can edit, how to use the class: 'form-control', etc.

<%= simple_form_for @admin_category, as: 'user_basic' do |f| %>
  <%= f.input  :name, label: 'Nome' %>
  <%= f.input  :active, as: :check_boxes, label: 'Ativo' %>
  <%= f.button :submit %>
<% end %>

This code is from a simple form where I would like it to be just like the bootstrap fields, but it appears all disconfigured. Thank you for your attention!

    
asked by anonymous 26.02.2016 / 14:39

1 answer

0

Put input_html: { class: 'form-control' } in your input

<%= simple_form_for @admin_category, as: 'user_basic' do |f| %>
  <%= f.input  :name, label: 'Nome', input_html: { class: 'form-control', placeholder: "Nome" } %>
  <%= f.input  :active, as: :check_boxes, label: 'Ativo' %>
  <%= f.button :submit %>
<% end %>
    
03.03.2016 / 20:52