eggdrop
eggdrop

Reputation: 3366

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 ')'?

Upvotes: 1

Views: 530

Answers (1)

Jacob Mattison
Jacob Mattison

Reputation: 51052

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).

Upvotes: 4

Related Questions