ruby on rails 使用devise

1、在GemFile添加:gem 'devise', '~> 4.2', '>= 4.2.1'

2、终端执行:bundle install

3、终端执行:rails generate devise:install

4、在/app/views/layouts/application.html.erb,添加:

<%= notice %>

<%= alert %>

5、在终端执行:rails g devise:views

6、终端执行:rails generate devise User

7、终端执行: rake db:migrate

转载于:https://www.cnblogs.com/loveyixiang/p/6672699.html

你可能感兴趣的:(ruby on rails 使用devise)