I have a table called user and I just created a tagging system, where users can have tags through another table. Same way this rail cast does it for it's Books and Authors.
Now I have a search already which is based this way:
def self.text_search(query)
if query.present?
where("first_name @@ :q OR last_name @@ :q OR country @@ :q OR (first_name || ' ' || last_name) @@ :q", :q => query)
else
scoped
end
end
if I don't have a field inside the user table to search for it, any one can suggest me a join search ? I just can't figure out the syntax with pg_search
There is a Gem called Texticle , and here is an awesome Railscast about it! Check it out! It does the job well!