how to add a class to the input component in a wrapper in simple_form 2

前端 未结 5 1059
难免孤独
难免孤独 2021-02-04 04:57

I am trying to have class=\"text\" in my input fields when using a custom wrapper called :hinted in simple_form 2.0.0.rc

config.wrappers :hinted do          


        
5条回答
  •  抹茶落季
    2021-02-04 05:37

    Currently there no way to do this. You can use the defaults options like this if you want.

    <%= simple_form_for(@user, :defaults => { :input_html => { :class => "text" } }) do %>
      <%= f.input :name %>
    <% end %>
    

提交回复
热议问题