Try calling the method to_s
, like so
%ul
- post.tags.each do |tag|
- tag_plus_hash = '#' + tag.to_s
%li= link_to tag_plus_hash, posts_path(tag: tag.name)
Or even better, use interpolation
%ul
- post.tags.each do |tag|
- tag_plus_hash = "##{tag}"
%li= link_to tag_plus_hash, posts_path(tag: tag.name)