before_action class コントローラ名 < ApplicationController before_action :処理させたいメソッド名 onlyやexceptなどのオプションを使用することで、実行前に、処理を実行させるかなど制限が可能。 class コントローラ名 < ApplicationController before_action :set_item, only: [:edit, :show] def edit end def show end private def set_item @item = Item.find(params[:id]) end end …
herokuでファイル名でアップできなかったときの対処法〜複製して再アップ〜
ファイルの複製 まず右クリックでファイルを複製する ファイル名を変更する config/database.yml development: <<: *default database: 〇〇_development # 省略 test: <<: *default database: 〇〇_test # 省略 production: <<: *default database: 〇〇_production username: 〇〇 password: <%= ENV['USER_APP_DATABASE_PASSWORD'] %> *〇〇の部分を変更 .gitを削除 % ls -a grep…
「ブログリーダー」を活用して、kisserさんをフォローしませんか?
指定した記事をブログ村の中で非表示にしたり、削除したりできます。非表示の場合は、再度表示に戻せます。
画像が取得されていないときは、ブログ側にOGP(メタタグ)の設置が必要になる場合があります。