I have setup Devise, I have set up the below code in my user.rb file
def self.create_auto_password
generated_password = Devise.friendly_token.first(8)
self.create(password: generated_password, password_confirmation: generated_password)
end
I then tried to generate a registrations controller by running
rails generate devise:controllers -c registrations
and a few other variations but it won't generate... what is the correct command to create a registrations controller in Devise?
just create the controller manually and make it inherit from Devise. For example:
class Users::RegistrationsController < Devise::RegistrationsController
# Override the action you want here.
end
This controller should live in app/controllers/users/registrations_controller.rb
And mention it in your routes.
devise_for :users, controllers: { registrations: "users/registrations" }
And if you want to only generate it by command than you need to add device gem from master branch because that generator is present on that branch.
gem 'devise', git: 'https://github.com/plataformatec/devise'
As mention on github_issue
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments