LoginSignup
0
0

More than 3 years have passed since last update.

deviseのgemで、ユーザーの詳細ページや編集ページは作れないかなぁ…

Posted at

はじめに

 deviseをを使ってユーザー管理機能を実装した。マイページを作って編集をできるようにしたい。しかし、deviseのコントローラーでできるのか、不安だったので、deviseで作ったuserディレクトリの配下には作らず、別でuserコントローラーを作った。似たようなディレクトリとファイルがあるので、なんかモヤモヤする。

userコントローラー

ターミナルで、

rails g controller users

を行うと、controllers/users_controller.rbファイルが生成される。

users_controller.rb
class UsersController < ApplicationController
  def show
    @user = User.find(params[:id])
  end
end

まあ、こうすれば詳細ページを作れるのだが…

終わりに

 deviseのコントローラーにはコメントアウトされている部分がたくさんあるが、この中に詳細を表示させたり、編集したりすることは

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0