aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2013-01-05 14:45:18 +0900
committerAkira Matsuda <ronnie@dio.jp>2013-01-06 15:41:14 +0900
commit70ae89c321444eef42c0c011b522f926250e7acd (patch)
tree0f7abe41af87a17deb5c90465d1e9a190e4a70a9 /actionpack/lib/action_view
parent3e8134a750bee5c4f7ede67f33263d36e4ff1474 (diff)
downloadrails-70ae89c321444eef42c0c011b522f926250e7acd.tar.gz
rails-70ae89c321444eef42c0c011b522f926250e7acd.tar.bz2
rails-70ae89c321444eef42c0c011b522f926250e7acd.zip
Remove unnecessary begin..rescue..end, use only rescue
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r--actionpack/lib/action_view/helpers/debug_helper.rb14
1 files changed, 6 insertions, 8 deletions
diff --git a/actionpack/lib/action_view/helpers/debug_helper.rb b/actionpack/lib/action_view/helpers/debug_helper.rb
index d361a69a92..34fc23ac1a 100644
--- a/actionpack/lib/action_view/helpers/debug_helper.rb
+++ b/actionpack/lib/action_view/helpers/debug_helper.rb
@@ -27,14 +27,12 @@ module ActionView
# new_record: true
# </pre>
def debug(object)
- begin
- Marshal::dump(object)
- object = ERB::Util.html_escape(object.to_yaml).gsub(" ", "&nbsp; ").html_safe
- content_tag(:pre, object, :class => "debug_dump")
- rescue Exception # errors from Marshal or YAML
- # Object couldn't be dumped, perhaps because of singleton methods -- this is the fallback
- content_tag(:code, object.to_yaml, :class => "debug_dump")
- end
+ Marshal::dump(object)
+ object = ERB::Util.html_escape(object.to_yaml).gsub(" ", "&nbsp; ").html_safe
+ content_tag(:pre, object, :class => "debug_dump")
+ rescue Exception # errors from Marshal or YAML
+ # Object couldn't be dumped, perhaps because of singleton methods -- this is the fallback
+ content_tag(:code, object.to_yaml, :class => "debug_dump")
end
end
end