2019-02-01から1ヶ月間の記事一覧
データベースをメイン(?)に扱いだしてから 結構な頻度で使うようになったので、メモすることにした。 (結局よく使ってもよく忘れる悲劇・・・) 1.とりあえずまずはマイグレーションファイルを作成する rails g migration 作業内容がわかるようなファ…
APIで取得したデータに日付データ(String型)があったのですが、 Date型に変換したかったので調べた。 Date.strptime('String型の日付データ', '%Y-%m-%d') 'String型の日付データ'.to_date どっちでもいけた。 これだけでよかったのか・・・(゜ω゜=) ※追記…
とくにデプロイ時に忘れていることが多い。 忘れがちだけど、herokuでもmigrateが必要。 $ heroku run rake db:migrate herokuのDBをリセットする場合。 $ heroku pg:reset DATABASE イニシャルセット $ heroku git:remote -a アプリケーション名 プッシュコ…
Bootstrap4 Gemfileに追記する gem 'bootstrap' gem'jquery-rails' application.scssに追記する // Custom bootstrap variables must be set or imported *before* bootstrap. @import "bootstrap"; application.jsに追記する //= require jquery3 //= requi…
remote: ! You must use Bundler 2 or greater with this lockfile. 以下のコマンドでビルドパッケージを追加すればOK。 $ heroku buildpacks:set https://github.com/bundler/heroku-buildpack-bundler2