Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding an ID or Class in Ruby on Rails?

I've got the following code for a search form, but how would I add an ID or a class to the submit button?

<% form_tag '/wine/search/', :method => 'get' do %>
    <%= label_tag "Search" %>
    <%= text_field_tag :search_string, params[:search_string] %>
    <%= submit_tag "Go" %>
<% end %>

Thanks

like image 897
Probocop Avatar asked Mar 25 '10 15:03

Probocop


1 Answers

submit_tag "Go", :class => "some_class"
submit_tag "Go", :id=> "some_id"

From the Rails API FormTagHelper

like image 90
clyfe Avatar answered Sep 21 '22 18:09

clyfe