diff options
author | Jorge Bejar <jorge@wyeworks.com> | 2015-07-20 16:37:19 -0300 |
---|---|---|
committer | Jorge Bejar <jorge@wyeworks.com> | 2015-12-09 10:53:45 -0300 |
commit | 668d94fff644e87d49004e4f48143f5561e8c9a0 (patch) | |
tree | a38264d4c13a414c50f4093e100630583ed163c1 /railties/lib/rails/generators | |
parent | 6fb2afed5284c7bc0157055609a0fde9ea4518d0 (diff) | |
download | rails-668d94fff644e87d49004e4f48143f5561e8c9a0.tar.gz rails-668d94fff644e87d49004e4f48143f5561e8c9a0.tar.bz2 rails-668d94fff644e87d49004e4f48143f5561e8c9a0.zip |
Add debug_exception_response_format config to configure DebugException
behavior
Diffstat (limited to 'railties/lib/rails/generators')
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt index 4dd20a9d2e..eaa885671b 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt @@ -23,7 +23,15 @@ Rails.application.configure do config.action_controller.perform_caching = false config.cache_store = :null_store end + <%- if options[:api] -%> + # Return error responses in the format requested by the client + # or default to JSON format. + # This option is useful for Rails API only applications developers + # who prefer to render errors in the expected format instead of + # rendering a HTML page with debug info and web-console. + config.debug_exception_response_format = :api + <%- end -%> <%- unless options.skip_action_mailer? -%> # Don't care if the mailer can't send. |