Post

jbuilderを使用するとレスポンスが空になる

解決

active_decorator のバージョンを 1.1.0 から 1.3.1 に上げた為。

同様の事象が記載されているPRは見られない。(改修は未定) Pull Requests · amatsuda/active_decorator

事象

render 'template_name', formats: 'json', handlers: 'jbuilder' のように、jsonのレスポンスを jbuilder を経由して行なっていたら、設定した値のレスポンスが空になる。

render json: { hoge: hoge } は機能する。

This post is licensed under CC BY 4.0 by the author.