diff options
author | Andrew White <andyw@pixeltrix.co.uk> | 2011-06-15 01:20:50 +0100 |
---|---|---|
committer | Andrew White <andyw@pixeltrix.co.uk> | 2011-06-15 01:21:04 +0100 |
commit | 0ac0d7a0f03da3d08440c74477d653622d61a26e (patch) | |
tree | 2b6a585e295fdf854f02fd44fa8241ab13a4217a /actionpack/lib/action_view | |
parent | 56b301fa7a9f4b1ab2b7b5daf9444555b85d3359 (diff) | |
download | rails-0ac0d7a0f03da3d08440c74477d653622d61a26e.tar.gz rails-0ac0d7a0f03da3d08440c74477d653622d61a26e.tar.bz2 rails-0ac0d7a0f03da3d08440c74477d653622d61a26e.zip |
Make MissingTranslation exception handler respect :rescue_format
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/helpers/translation_helper.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/translation_helper.rb b/actionpack/lib/action_view/helpers/translation_helper.rb index fd8fe417d0..e5bd55e935 100644 --- a/actionpack/lib/action_view/helpers/translation_helper.rb +++ b/actionpack/lib/action_view/helpers/translation_helper.rb @@ -5,7 +5,11 @@ module I18n class ExceptionHandler include Module.new { def call(exception, locale, key, options) - exception.is_a?(MissingTranslation) ? super.html_safe : super + if exception.is_a?(MissingTranslation) + options[:rescue_format] == :html ? super.html_safe : super + else + super + end end } end |