randombits
randombits

Reputation: 48490

In a Rails form, how does one create <button>

More specifically, I need to create <button type="submit">Foo</button> type markup in my Rails form. Is there a helper for that?

Upvotes: 2

Views: 8803

Answers (2)

Jesse Wolgamott
Jesse Wolgamott

Reputation: 40277

Nope, you could obviously do in HTML, or

<%= content_tag(:button, "Foo", :type=>:submit)%>

But if you want to do the following then check out Rails Button Tag :

<%= button_tag "Foo"%> 

Upvotes: 9

<%= submit_tag "Foo" %>

Here is the documentation for rails form helpers ActionView::Helpers::FormHelper.

Upvotes: 0

Related Questions