dish.tag_list.each do |tag|
end
-Jonathan.
On 9/22/07, peninha
<mauricio.pena-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
>
> 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
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---