Enner31
Enner31

Reputation: 203

How to change the name given with devise ?

I'm currently working on my personal website. By adding devise gems to my code, I'va made a mistake.

I've written :

rails generate devise MODEL

and I want :

rails generate devise User

I know I could just start over, but I want to know first if it is possible to change this and if it is, how could I do that ?

Many thanks,

Raphaël.

Upvotes: 2

Views: 640

Answers (2)

Simon Franzen
Simon Franzen

Reputation: 2727

Remove the table:

rake db:rollback VERSION=versionNumberOfMigration

Remove the configuration:

rails destroy devise:install

Remove your User model:

rails destroy devise MODEL

Check the references to devise in your routes.rb, controllers and views.

Also check for the following code snippets in your project:

  • devise_for (routes.rb)
  • before_action :authenticate_MODEL! (controllers)
  • MODEL_signed_in? (controllers, views) current_MODEL
  • MODEL_session (controllers, views)

Upvotes: 4

Manoj Menon
Manoj Menon

Reputation: 1038

Have you tried

rails destroy devise MODEL

Upvotes: 1

Related Questions