views:

17

answers:

1

My code:

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

I want to end up with this:

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

but what I'm getting is:

<input type=submit value=submit/>

how to set the class?

+2  A: 

The HTML options are the third parameter according to the documentation. Try this:

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