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

how to include groupify in a rails engine #36

Open
nxia416 opened this issue Oct 19, 2015 · 2 comments
Open

how to include groupify in a rails engine #36

nxia416 opened this issue Oct 19, 2015 · 2 comments
Labels

Comments

@nxia416
Copy link

nxia416 commented Oct 19, 2015

Hi,

I am trying to use groupify in a rails engine. Now I have "require 'groupify' " in my engine.rb, however I keep getting the errors saying "undefined method `groupify'" from my active_record models. Do you have any suggestions for correctly including groupify in an engine?

@dwbutler
Copy link
Owner

Referring to the instructions here, did you do the following?

  • Add groupify to your engine's .gemspec
  • Require groupify before the engine's initialization?

FYI, in Rails Groupify is set up via a Railtie. The Railtie is required in groupify.rb, and the ActiveRecord adapter is required in railtie.rb.

If you're doing everything correctly in your engine, the problem could be a Railtie load order problem.

@dwbutler
Copy link
Owner

I created a sample Rails Engine using Groupify with setup instructions here:

https://github.com/dwbutler/groupify_sample_rails_engine

I'll be adding this to the Groupify README.

Let me know if this helps solve your issue.

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

No branches or pull requests

2 participants