标签: ruby-on-rails ruby
如何设置它以便它只在更新操作时弹出而不是创建?
= f.submit, data: { confirm: "you are about to update object, are you sure?" }
答案 0 :(得分:1)
尝试这样的事情
= f.submit, data: action == 'edit' ? { confirm: "you are about to update object, are you sure?" } : {}