Blankman
Blankman

Reputation: 266920

rails button_to is not setting the class correctly

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?

Upvotes: 3

Views: 2258

Answers (1)

Jimmy
Jimmy

Reputation: 37081

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

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

Upvotes: 9

Related Questions