Hi,
I have set up acts_as_taggable_on_steroids and it works great. But I’m
having trouble spliting the tag_list string to generate individual
links for each tag.
I’m getting the data in my controller:
@dishes = Dish.find_tagged_with(params[:tag])
then in my view I do this:
<%
tags = dish.tag_list.split
for tag in tags %>
<%= link_to tag, :controller=> ‘dish’,
:action => ‘search_dish_by_tag’,
:tag => tag %>
<% end %>
This works for single words but it’s also splitting the words enclosed
in single cotes. So if I have a tag like ‘noodle soup’ it’d generate 2
links ‘noodle and soup’. Do I have to use a reg. expression here or
there’s an easier way to do this?
thanks in advance,
Mauricio