我正在使用 simple_form、nested_form 和 Twitter Bootstrap,并尝试将nested_form 中的“删除链接”与对象放在同一行。
现在看起来像这样:
http://grab.by/eKDS http://grab.by/eKDS
我希望它看起来像这样:
http://grab.by/eKEc http://grab.by/eKEc
我的代码如下所示:
<%= cform.simple_fields_for :licensings do |lf| %>
<%= lf.input :state, :collection => us_states, :wrapper => false %>
<%= lf.link_to_remove "Remove this Licensing", :class => 'btn btn-mini btn-danger' %>
<% end %>
我尝试将第二个 link_to_remove 放在第一个 lf.input 的块内,但实际的下拉列表没有出现。我查看了 simple_form 的代码,但无法找到是否有办法实现此目的。
感谢您的回答,但我无法工作。我在 Google 网上论坛邮件列表中找到了答案:
https://groups.google.com/forum/?fromgroups#!topic/plataformatec-simpleform/hL9ek5svyAU https://groups.google.com/forum/?fromgroups#!topic/plataformatec-simpleform/hL9ek5svyAU
<%= cform.simple_fields_for :licensings do |lf| %>
<%= lf.input :state do %>
<%= lf.input_field :state, :collection => us_states %>
<%= lf.link_to_remove "Remove this Licensing", :class => 'btn btn-mini btn-danger' %>
<% end %>
<% end %>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)