开发者

Ruby-on-rails gem failing for "where" condition of meta_where

I have a question about what is probably a gems problem, but may be meta-where. I used gems to install meta_where-1.0.4, and the response was that I succeeded and the uri for meta_where was provided, but when I tried a where-condition in the search method of a controller, similar to this example that meta-where provides:

Person.where(:skill_set.matches => 'Hello%'

an error was reported:

"undefined method 'matches' for :skill_set:Symbol"

It's as if the gem's methods aren't being accessed. I 开发者_Python百科tried using "require" but that didn't help.

I'm using Windows XP, Firefox, Ruby 1.9.2.

What do I need to do? Thanks, Barney


I assume you have run the migrations and there is a skill_set attribute in the person table: you don't need require. Just add 'gem meta_where' to your Gemfile and then run 'bundle install'.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜