Ruby: how to uninstall Devise?

后端 未结 5 1328
广开言路
广开言路 2020-12-07 12:05

I have installed Devise and now want to remove it, including all the files it has generated. How do I do that?

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-07 12:51

    Use the generator to remove configuration files as well (step 2), so the whole process would be (referencing previous answers):

    1. Remove the table: rake db:rollback VERSION=
    2. Remove the configuration: rails destroy devise:install
    3. Remove your User model: rails destroy devise User (replace 'User' with the name of your model)
    4. Remove references to devise in your routes.rb, gemfile, controller files, and view files like the following, if you used them (once again replacing 'user' with your model name):
      • devise_for (routes.rb)
      • gem 'devise' (gemfile)
      • before_action :authenticate_user! (controllers)
      • user_signed_in? (controllers, views)
      • current_user (controllers, views)
      • user_session (controllers, views)

提交回复
热议问题