Lashe
Lashe

Reputation: 31

How to change devise views model in an existing app

So, I have actually generated the views for devise but recently i want to change it back to another name, how will i?

Initially it was rails g devise 'Writer'... now, i want rails g devise 'User'

Thanks.

Upvotes: 0

Views: 329

Answers (3)

Lashe
Lashe

Reputation: 31

Everything now works fine. I deleted the writer's column from the database and generated another one.

Upvotes: 0

adc
adc

Reputation: 781

if you cannot destroy your devise model then one method is to

rename occurrences of user_signed_in?, current_user, user_session (see devise helpers)

Rename your db table name (migration), modify your tests files, model and route to devise_for :users.

Upvotes: 0

Ritesh Ranjan
Ritesh Ranjan

Reputation: 1012

Destroy and then generate the model.

First:

 rails destroy devise Writer

then:

rails generate devise User

It would be more easier and recommended then changing.

Upvotes: 1

Related Questions