"s-6ren">
gpt4 book ai didi

ruby-on-rails - 在Ruby on Rails中添加ID或类?

转载 作者:行者123 更新时间:2023-12-04 04:48:10 25 4
gpt4 key购买 nike

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

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

谢谢

最佳答案

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

Rails API FormTagHelper

关于ruby-on-rails - 在Ruby on Rails中添加ID或类?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2516744/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com