Herokuのデプロイエラー
Herokuでpush(デプロイ)できない、こんなエラーが。
Build timed out while waiting to start.
! [remote rejected] master -> master (pre-receive hook declined)
解決策
heroku maintenance:on
メンテナンスモードにして、再度git push heroku master。
動いた。
heroku maintenance:off
で戻して無事解決。
たれみみ
@taremimi_7
Deviseでサインイン後に任意のアクションへ飛ばす【Ruby on Rails】
app/controllers/application_controller.rbに以下を追加。
def after_sign_in_path_for(resource)
******_path(current_devise_user.id)
end
メモメモ。
@taremimi_7
Rails高速化参考サイト
Rails5のチャットでメッセージが重複する謎。
app/assets/javascripts/channels/*****.coffeeで、App.cable.subscriptions.create前に
if (!App.order) を入れたら重複が取り除けます。(orderは直後にApp.cable...を代入する変数(?メソッド名?テーブル名?)に変えて下さい。)
※インデント注意して下さい
~~省略~~
if (!App.order)
App.order = App.cable.subscriptions.create { channel: "OrderChannel",order_id: messages.data('order_id'),name: messages.data('devise_id')},
connected: ->
~~省略~~
turbolinks:loadのせいで重複なるらしいです。(あ、上の赤色部分を付け足せばturbolinks:loadを消さずとも動きます)
ではでは。
@taremimi_7
Railsで子モデル持ってる親テーブル一覧取得
子モデル持ってる親テーブル一覧取得
**親モデル名***.where('(SELECT DISTINCT(****_id) FROM **子モデル名**s)')