[英]Rails how to programatically get html id from form
Say I have a Rails form like the following 说我有一个如下的Rails表单
<% form_for @model do |f| %>
<%= f.label :column %>
<%= f.check_box :column %>
<% end %>
Is there a way I can get the html id that will be generated for the 'column' check box? 有没有一种方法可以获取将为“列”复选框生成的html id? What would be great is if there was a way to add in
最好的是,如果有一种添加方法
<%= f.observe_field :column, options %>
Anyone know how to add this to FormBuilder? 有人知道如何将其添加到FormBuilder吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.