[rails]deviseでのログイン画面実装
deviseでのログイン画面実装
1.Gemfileに「gem 'devise'」を追加
gem 'devise'
2.追加したdeviseを、アプリケーションに読み込ませる。
※gemを追加した時に忘れてはいけない
$ bundle install
3.deviseの初期設定
$ rails g devise:install
これでdeviseを使う準備は完了。
4.Userモデルとマイグレーションファイルを作成
rails g devise モデル名の記述は、devise独自のルールです。
$ rails g devise User
5.データベースへ反映
新しくUserテーブルをデータベースへ反映させます。
$ rails db:migrate
6.deivse用のログイン画面を作成
$ rails g devise:views
7.rails s -b 0.0.0.0でサーバー起動させ、画面確認
Author And Source
この問題について([rails]deviseでのログイン画面実装), 我々は、より多くの情報をここで見つけました https://qiita.com/yusuke1209kitamura/items/2d6154f0df88f74602bf著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .