3

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?

Brad Mace
  • 27,194
  • 17
  • 102
  • 148
Blankman
  • 259,732
  • 324
  • 769
  • 1,199

1 Answers1

9

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

<%= button_to 'Login', {}, { :type => 'submit', :class => 'submit' } %>
Jimmy
  • 35,686
  • 13
  • 80
  • 98