aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers/form_options_helper.rb
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-07-22 14:27:19 -0300
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-07-22 14:36:10 -0300
commitb973852febaac607cb7a602e10b8c04e320822e1 (patch)
tree601a0b14a607adcc52b76a5aa672e58e69d6ee28 /actionview/lib/action_view/helpers/form_options_helper.rb
parentc23c193a8428985d810f96cfeb56ec2001cb1f2a (diff)
downloadrails-b973852febaac607cb7a602e10b8c04e320822e1.tar.gz
rails-b973852febaac607cb7a602e10b8c04e320822e1.tar.bz2
rails-b973852febaac607cb7a602e10b8c04e320822e1.zip
Use merge! to avoid a new hash and change some spots to 1.9 hash style
Diffstat (limited to 'actionview/lib/action_view/helpers/form_options_helper.rb')
-rw-r--r--actionview/lib/action_view/helpers/form_options_helper.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/actionview/lib/action_view/helpers/form_options_helper.rb b/actionview/lib/action_view/helpers/form_options_helper.rb
index f886fa34ee..a9ee235e2a 100644
--- a/actionview/lib/action_view/helpers/form_options_helper.rb
+++ b/actionview/lib/action_view/helpers/form_options_helper.rb
@@ -384,8 +384,8 @@ module ActionView
end
selected, disabled = extract_selected_and_disabled(selected)
select_deselect = {
- :selected => extract_values_from_collection(collection, value_method, selected),
- :disabled => extract_values_from_collection(collection, value_method, disabled)
+ selected: extract_values_from_collection(collection, value_method, selected),
+ disabled: extract_values_from_collection(collection, value_method, disabled)
}
options_for_select(options, select_deselect)
@@ -444,7 +444,7 @@ module ActionView
option_tags = options_from_collection_for_select(
group.send(group_method), option_key_method, option_value_method, selected_key)
- content_tag(:optgroup, option_tags, :label => group.send(group_label_method))
+ content_tag(:optgroup, option_tags, label: group.send(group_label_method))
end.join.html_safe
end
@@ -516,7 +516,7 @@ module ActionView
body = "".html_safe
if prompt
- body.safe_concat content_tag(:option, prompt_text(prompt), :value => "")
+ body.safe_concat content_tag(:option, prompt_text(prompt), value: "")
end
grouped_options.each do |container|
@@ -528,7 +528,7 @@ module ActionView
label, container = container
end
- html_attributes = { :label => label }.merge(html_attributes)
+ html_attributes = { label: label }.merge!(html_attributes)
body.safe_concat content_tag(:optgroup, options_for_select(container, selected_key), html_attributes)
end
@@ -565,7 +565,7 @@ module ActionView
end
zone_options.safe_concat options_for_select(convert_zones[priority_zones], selected)
- zone_options.safe_concat content_tag(:option, '-------------', :value => '', :disabled => 'disabled')
+ zone_options.safe_concat content_tag(:option, '-------------', value: '', disabled: 'disabled')
zone_options.safe_concat "\n"
zones = zones - priority_zones
@@ -748,7 +748,7 @@ module ActionView
end
def prompt_text(prompt)
- prompt.kind_of?(String) ? prompt : I18n.translate('helpers.select.prompt', :default => 'Please select')
+ prompt.kind_of?(String) ? prompt : I18n.translate('helpers.select.prompt', default: 'Please select')
end
end