diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2015-12-08 23:52:53 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2015-12-08 23:52:53 +0900 |
commit | ba9e6119ddbe1a24a4c9c01abdb161f6641e2748 (patch) | |
tree | 9d18e4199f8c5028a1d9a452fd307fc8a7d2f856 /app/controllers/application_controller.rb | |
parent | 675512791a589990865405db9399be1ba31ed1c7 (diff) | |
download | aclog-ba9e6119ddbe1a24a4c9c01abdb161f6641e2748.tar.gz |
app: fix atom feed
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r-- | app/controllers/application_controller.rb | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index a3c86f3..402efee 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -50,13 +50,18 @@ class ApplicationController < ActionController::Base end def force_json - request.format = :json unless params[:format] == :atom + request.format = :json unless request.format.atom? end alias __render__ render - - def render(*args) - raise ArgumentError, "don't use render, use render_json" + if Rails.env.development? + def render(*args) + if request.format.atom? + super(*args) + else + raise ArgumentError, "don't use render, use render_json" + end + end end def render_json(data:, **kwargs) |