Custom id on form button

Asked

Viewed 45 times

0

I have a button to send a form

<div class="actions">
     <%= f.submit, html: {class: "button"}%>
</div>

But none of the HTML attributes (class and id) work, just cause me error on the page. Does anyone know how I can put an id or class of my choice?

  • Dude, I think it was because you put the class out of the tag. You have to put this button class together with the actions class.

1 answer

0


Thus:

<%= f.submit nil, class: 'btn btn-default' %> 

Browser other questions tagged

You are not signed in. Login or sign up in order to post.