hi
i am trying to find similar records, ie. look up Posts with the same
tag, kinda like if u like this then you may be interested in this
also...
but am having a strange problem.
if i post a tag name with the url and use this code
tag_name = params[:id]
@posts=Tag.find_by_name(tag_name).tagged
it all works. but if i do this
@randomtag = @posts.tags.find(:first, :order => ''RAND()'')
@suggestion = Tag.find_by_name(@randomtag).tagged
it breaks. i can see that @randomtag is returning the corrrect result.
and also if i put
@suggestion = Tag.find_by_name(''books'').tagged
then it works. [sound of me scratching my head]
please help.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
hi
i am trying to find similar records, ie. look up Posts with the same
tag, kinda like if u like this then you may be interested in this
also...
but am having a strange problem.
if i post a tag name with the url and use this code
tag_name = params[:id]
@posts=Tag.find_by_name(tag_name).tagged
it all works. but if i do this
@randomtag = @posts.tags.find(:first, :order => ''RAND()'')
@suggestion = Tag.find_by_name(@randomtag).tagged
it breaks. i can see that @randomtag is returning the corrrect result.
and also if i put
@suggestion = Tag.find_by_name(''books'').tagged
then it works. [sound of me scratching my head]
please help.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---