エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
seedとfakerでランダムなユーザーデータを作成し、RailsでUser-APIを実装する。 - Qiita
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
seedとfakerでランダムなユーザーデータを作成し、RailsでUser-APIを実装する。 - Qiita
users.controller.rb class UsersController < ApplicationController before_action :set_user, only: ... users.controller.rb class UsersController < ApplicationController before_action :set_user, only: %i[show update destroy] def index users = User.order(created_at: :desc) render json: { status: 'SUCCESS', message: 'Loaded users', data: users } end def show render json: { status: 'SUCCESS', message: 'Loaded the user', data: @user } end def create user = User.new(user_params) if user.save render json: