【发布时间】:2020-10-12 03:38:19
【问题描述】:
我正在尝试在帮助程序中使用块,
但这给了我这个错误:
SyntaxError - syntax error, unexpected ')'
...rbout.concat(( green_title do ).to_s); _erbout.concat "\n ...
... ^
(erb):4254: syntax error, unexpected end-of-input, expecting ')'
; _erbout.force_encoding(__ENCODING__)
^:
(erb):1649:in `'
我是这样称呼它的:
<%= green_title do %>
text
<% end %>
这是我的助手:
def green_title(&block)
capture do
concat content_tag(:h3) do
yeld
end
end
end
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-4 helper actionview