You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
github.com/BrucePerens/perens-instant-user/ is an example Rails Engine that adds Devise to the application while keeping most of the complexity of using Devise in the engine rather than your application.
It contains pre-defined mountable routes for Devise, and a pre-defined User model. Its installation steps are easier than those of stand-alone Devise. Unlike stand-alone Devise, you aren’t advised to become a Ruby Wizard before installing it :-)
Building it was almost identical to installing Devise in an application. However, I had to tell Devise that the routes it should use are in the engine rather than the main application. To do this, define Devise.router_name to be a symbol containing the name of the mountable engine’s named-route set. In my engine, I created config/initializers/devise.rb with these contents:
If your engine uses isolate_namespace, Devise will assume that all of its controllers reside in your engine rather than Devise. To correct this, include :module => :devise in the parameters of devise_for. Here’s my routes file: