Rails - Simple Form - Not loading class option
-
28-10-2019 - |
Question
I'm having some troubles when I want to change the class of a form. I have this partial:
<%= simple_form_for(@activity) do |f| %>
<%= f.input :name %>
<%= f.submit 'Guardar',:class=>"btn success" %>
<% end %>
In the browser the form label has class="simple_form activity"
According to Simple Form documentation, I can change the class by doing this
<%= simple_form_for(@activity, :defaults=>{:class=>"my_class"}) do |f| %>
But nothing is happening, what is wrong?
JavierQ
Solution
I think you want to use:
:html => { :class => "btn success"}
Instead of:
:class=>"btn success"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow