在Ruby on Rails中添加ID或类?

时间:2010-03-25 15:16:34

标签: ruby-on-rails

我为搜索表单提供了以下代码,但是如何在提交按钮中添加ID或类?

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

由于

1 个答案:

答案 0 :(得分:21)

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

来自Rails API FormTagHelper