sakiko0921 / May_2024_mini_App_week

ミニアプリウィーク用
0 stars 0 forks source link

ユーザー登録ページ #13

Open sakiko0921 opened 2 months ago

sakiko0921 commented 2 months ago
  1. ニックネームとパスワードでの新規機能
    • [x] sorceryGemをインストール
    • [x] rails g sorcery:installを実行
    • カラムにnameを追加する
    • rails db:migrateを実行
    • [x] Usersコントローラーの生成
    • new, createアクション
    • [x] ユーザー登録用のviewを作成
    • [x] ルーティングを追加
    • [x] バリデーション
    • nameは被らないこと、空白禁止
    • passwordは空白禁止
    • authenticates_with_sorcery!
      validates :password, length: { minimum: 3 }, if: -> { new_record? || changes[:crypted_password] }
      validates :password, confirmation: true, if: -> { new_record? || changes[:crypted_password] }
      validates :password_confirmation, presence: true, if: -> { new_record? || changes[:crypted_password] }
  2. ログイン機能実装
    • [x] user_sessionsコントローラーを生成
    • new, createアクション
    • [x] ログインページ作成
    • [x] ルーティングを追加
  3. ログアウト機能実装
    • [x] user_sessionsコントローラーに
    • destroyアクションを追加
    • [x] ルーティングを追加
  4. before_actionにrequire_loginを追加
    • [x] applicationsコントローラー
  5. skip_before_action
    • [x] user_sessions#new, create
    • [x] static_pages#top
    • [x] users#new, create
sakiko0921 commented 2 months ago
sakiko0921 commented 2 months ago