Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined method table_name #8

Open
reiz opened this issue May 15, 2012 · 2 comments
Open

undefined method table_name #8

reiz opened this issue May 15, 2012 · 2 comments

Comments

@reiz
Copy link

reiz commented May 15, 2012

I tried to integrate this lib into a running application. The action on the controller is called, but it throws an exception:

NoMethodError (undefined method table_name' for Product:Class): rails3-jquery-autocomplete (1.0.7) lib/rails3-jquery-autocomplete/orm/active_record.rb:7:inget_autocomplete_order'
rails3-jquery-autocomplete (1.0.7) lib/rails3-jquery-autocomplete/orm/active_record.rb:19:in get_autocomplete_items' rails3-jquery-autocomplete (1.0.7) lib/rails3-jquery-autocomplete/autocomplete.rb:55:inblock in autocomplete'

It seems that the lib tries to use active_record, but I am using MongoID. Actually I am not sure why this should work with Mongo. In the tutorial I am missing the point where the orm will be selected. How can I tell the library to use MongoID instead of active_record?

Thanks.

@reiz
Copy link
Author

reiz commented May 18, 2012

In the mean time I implemented the auto-complete function with pure jQuery and a little bit Ruby code. But I still would like to know why this gem didn't worked out for me.

Many Thanks,
Robert

@jurajpaulo
Copy link

the gem needs to appear in Gemfile after the mongoid gem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants