【发布时间】:2011-12-07 06:57:24
【问题描述】:
我正在使用semantic_form_for,我想知道是否有这样的属性:完成然后在成功创建后,表单会提醒一些东西,以便用户必须点击“确定”才能继续?
【问题讨论】:
标签: ruby formtastic
我正在使用semantic_form_for,我想知道是否有这样的属性:完成然后在成功创建后,表单会提醒一些东西,以便用户必须点击“确定”才能继续?
【问题讨论】:
标签: ruby formtastic
你的意思是提交前确认吗?
你可以使用类似下面的东西:
<%= semantic_form_for @user do |f| %>
...
<%= f.buttons do %>
<%= f.commit_button :button_html => {:confirm => 'Are you sure?'} %>
<% end %>
<% end %>
【讨论】:
我的解决方案如下,效果很好:
<%= semantic_form_for @post do |f| %>
...
<%= f.action :submit, :button_html => { 'data-confirm'.to_sym => 'Are you sure?' } %>
<% end %>
【讨论】: