In my _updates.html.haml
file in my home view of my rails app, I am accessing
a bunch of posts with the @posts = Post.tagged_with(params[:tag])
in my home controller. I am doing an each iteration on @posts
and am trying to prepend a '#' symbol in front of the tag name so that the '#' is part of the link in the link_to statement.
I am trying the following but I get a typeerror.
%ul
- post.tags.each do |tag|
- tag_plus_hash = '#' + tag
%li= link_to tag_plus_hash, posts_path(tag: tag.name)
My error is the following:
can't convert ActsAsTaggableOn::Tag into String