From c0ec40c83a7e2370f0f4a01055aafb69026d8099 Mon Sep 17 00:00:00 2001 From: Ruben Fonseca Date: Tue, 21 Feb 2012 17:03:42 +0000 Subject: Refactored two methods to use delete with a block --- actionpack/lib/abstract_controller/layouts.rb | 2 +- actionpack/lib/action_view/helpers/form_tag_helper.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'actionpack') diff --git a/actionpack/lib/abstract_controller/layouts.rb b/actionpack/lib/abstract_controller/layouts.rb index 6a6387632c..aa39e21ba9 100644 --- a/actionpack/lib/abstract_controller/layouts.rb +++ b/actionpack/lib/abstract_controller/layouts.rb @@ -322,7 +322,7 @@ module AbstractController super if _include_layout?(options) - layout = options.key?(:layout) ? options.delete(:layout) : :default + layout = options.delete(:layout) { :default } options[:layout] = _layout_for_option(layout) end end diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb index 53fd189c39..2cf1c9055c 100644 --- a/actionpack/lib/action_view/helpers/form_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb @@ -313,7 +313,7 @@ module ActionView options["cols"], options["rows"] = size.split("x") if size.respond_to?(:split) end - escape = options.key?("escape") ? options.delete("escape") : true + escape = options.delete("escape") { true } content = ERB::Util.html_escape(content) if escape content_tag :textarea, content.to_s.html_safe, { "name" => name, "id" => sanitize_to_id(name) }.update(options) -- cgit v1.2.3