
エントリーの編集

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

- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
posts_controller.rb - Qiita
class PostsController < ApplicationController def index @posts = Post.all.order(created_at: :desc... class PostsController < ApplicationController def index @posts = Post.all.order(created_at: :desc) end def show @post = Post.find_by(id: params[:id]) end def new @post = Post.new end def create @post = Post.new(content: params[:content]) if @post.save # 変数flash[:notice]に、指定されたメッセージを代入してください flash[:notice]="投稿を作成しました" redirect_to("/posts/index") else render("posts/new") end end def edit @post = Pos