开发者

Why does this not work: link_to(current_user) do

<%= link_to(current_user) do %>
  #show other stuff between anchors like this:
  #<a href="/user/bob">show other stuff between anchors</a>
<% end %>

The error I get is:

compile error
syntax error, unexpected开发者_开发百科 ')'
...t(( link_to(current_user) do ).to_s); @output_buffer.concat ...

Why an unexpected ')'?


Because the "=" at the beginning of the link_to tag implies "take what's in this tag and output it as a string" (hence the "to_s" in the error message).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜