The #{{id}}
is being evaluated by Haml as string interpolation. So it sees the outer #{...}
as the container for the Ruby code to be evaluated (just like any standard Ruby code would), and it therefore tries to evaluate {id}
in Ruby.
Ruby sees the curly braces around id
and expects a hash, which is why you get the "unexpected '}'" error.
The solution is to escape the #
to avoid string interpolation:
%a{href: "\#{{id}}"} {{showName}}