【发布时间】:2011-12-28 06:21:50
【问题描述】:
我尝试过使用 ,但它不断添加双引号,这会导致 html 页面在我的 html 中逐字打印出来。这是我的示例代码:
helper.rb
def available_options
["test1 | test222 ", "test1 | test222 ", "test1 | test222 "]
end
在我看来:
= f.select, options_for_select(available_options)
有没有办法正确渲染这个东西?我试过 raw 和 html_safe 都无济于事。
【问题讨论】:
标签: html ruby-on-rails haml options