Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

Chris Tudor's Profile

GitHub User: christudor

Site: www.massolit.co.uk

Comments by Chris Tudor

Avatar

Great episode, as usual.

Is there any way to make this work for multi-word tags?

My index page works fine with one-word tags (e.g. 'superman', 'comic', etc.), but when I have a multi-word tag (e.g. 'the riddler', 'the penguin', etc.) I get the following error:

undefined method 'joins' for []:Array.

When I try to filter my articles by the tag 'Tag 3', the URL that I am directed to is:

http://localhost:3000/tags/Tag%203

I imagine it has something to do with this line:

rails
<p>Tags: <%= raw @article.tag_list.map { |t| link_to t, tag_path(t) }.join(", ") %></p>

Anyone know how to make this work with multi-word tags?