2019-02-27から1日間の記事一覧

application_controller.rb のrspecの書き方

例えばログインしたユーザーのニックネーム等に不備があった場合まず編集画面にリダイレクトさせたいという処理 application_controller.rb class ApplicationController < ActionController::Base before_action :authenticate_user! before_action :invali…

Rails5.1から render nothing: true が MissingTemplate になる

これだとダメになってた class UsersController < ApplicationController def show render nothing: true end end 5.1だとどちらかで書けるようになっている class UsersController < ApplicationController def show render body: nil end end class UsersC…