
エントリーの編集

エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
【Ruby】便利なやつだよ〜before_action編〜 - Qiita
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています

- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
【Ruby】便利なやつだよ〜before_action編〜 - Qiita
class ItemsController < ApplicationController def index @items = Item.order('created_at DESC') en... class ItemsController < ApplicationController def index @items = Item.order('created_at DESC') end def new @item = Item.new end def create @item = Item.new(item_params) if @item.save redirect_to root_path else render :new end end def show @item = Item.find(params[:id]) end def edit @item = Item.find(params[:id]) redirect_to root_path unless current_user.id == @item.user_id end def update @item = I