【发布时间】:2014-10-10 23:40:55
【问题描述】:
为什么我不能从产量中放入参数?
错误:
undefined local variable or method `options' for #<#<Class:0x007fd1bd8735e8>:0x007fd1ba3e4fe8>
/app/helpers/bootstrap_form_helper.rb
...
def inline
options = "row_disable"
content_tag(:div, class: "row test") { yield(options) }
end
...
/app/views/signup/new.html.erb
...
<%= inline do %>
<%= options %>
<%= person_f.text_field(:last_name, control_col: 7) %>
<% end %>
...
【问题讨论】:
-
你想做什么?
-
因此,我尝试在 text_field 中传递此变量。但一开始,我不能把它放在浏览器中。
标签: ruby-on-rails yield