Rails button_to does not set the class correctly

My code is:

<%= button_to 'Login', {:type => 'submit', :class => 'submit'} , {}%>

I want to end with this:

<input type='submit' value='submit' class=submit/>

but I get:

<input type=submit value=submit/>

how to set a class?

+3
source share
1 answer

HTML parameters are the third parameter according to the documentation . Try the following:

<%= button_to 'Login', {}, { :type => 'submit', :class => 'submit' } %>
+9
source

Source: https://habr.com/ru/post/1772314/


All Articles