Ruby on Rails: Acts as Taggable searching like terms

I'd like to search tags that has similar terms. For instance if there's a tag that has two words, christmas shopping, I'd like to search all that has similar tags with christmas or shopping.

right now I have this

@tag = Boom.tagged_with(params[:tag], :any => true, :wild => true)

Is this possible? With just SQL there's such as thing with %or LIKE but can this be applied somehow with acts as taggable?

Thanks

Answers


Like we discussed upper in comments: if you make params[:tag].split(" ") it will be working.


Need Your Help

How requestdispatcher will work for rest service

java web-services rest servlets requestdispatcher

In servlet we can use requestdispatcher and it will forward from servlet to servlet or html file.but i tried this requestdispatcher in rest service.its not forwarding from service 1 to service 2.it...

Print an array forwarded from a servlet to a JSP

arrays jsp servlets printing jstl

I have forwarded an array userName[][] from a servlet to a JSP. I can access the array elements like ${userName[2][3]}, but i cant iterate through the array using a variable. e.g. ${userName[i][j]}...