我正在使用form_for帮助程序并希望将其提交到 iframe。
<%= form_for(section, :target => 'new_section_frame') do |f| %>
...
<% end %>
Run Code Online (Sandbox Code Playgroud)
然后我应该能够调用$('form').submit()并将表单提交到 iframe。除非目标不存在于输出 html 中,否则它会起作用。Rails关于表单助手的指南没有这个特定的示例。
与 html 相关的帮助器选项form_for必须位于 html 键中。就像这样:
<%= form_for(section, :html => {:target=>'new_section_frame'}) do |f| %>
...
<% end %>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3390 次 |
| 最近记录: |