背景
jpmobileのgemを使用して、hogehoge_smart_phoneみたいなファイル名にしたら、
使用デバイスに応じて、viewを表示してくれる便利なgem
(partialまでsmart_phone化するからちょっと好きではないw)
コード
respond_to do |format|
format.html
format.js
end
- remote: trueでgetしているのに、HTMLが返却されていた。
- action.js.erbはちゃんと用意してあって、アプリケーションサーバーも再起動済み
原因
- action.html.erb, action_smart_phone.html.erbが存在する場合は、action.js.erbもデバイスに応じて作らないといけなかった
- 例) pc: action.js.erb, sp: action_smart_phone.js.erb
トホホ