gpt4 book ai didi

ruby-on-rails - Rails 上的 ruby : How to have multiple submit buttons going to different methods (maybe with with_action? )

转载 作者:数据小太阳 更新时间:2023-10-29 06:46:00 27 4
gpt4 key购买 nike

<分区>

所以..

<%= submit_tag 'Save', :name => 'save' %>
<%= submit_tag 'Save to Library', :name => 'library' %>

然后在我的 Controller 中:

with_action do |a|
a.save do

end

a.library do

end
end

问题是只有一个操作被调用...两个 submit_tags 调用相同的操作...知道为什么吗?

或者我如何获得两个按钮以将表单提交给两种不同的方法?

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