views:

64

answers:

1
<%= 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 ')'?

+4  A: 

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

JacobM
This is right, you just need to take out the = and it will work as expected.
David