Browse files

Whitespaces ✂️

  • Loading branch information...
1 parent 1de3f63 commit 2e487bc65816b1dec3d444a8a6f80aaef7eb68d3 @rafaelfranca rafaelfranca committed Jan 5, 2012
View
9 actionpack/lib/action_view/helpers/form_options_helper.rb
@@ -134,7 +134,7 @@ module FormOptionsHelper
#
# ==== Gotcha
#
- # The HTML specification says when +multiple+ parameter passed to select and all options got deselected
+ # The HTML specification says when +multiple+ parameter passed to select and all options got deselected
# web browsers do not send any value to server. Unfortunately this introduces a gotcha:
# if an +User+ model has many +roles+ and have +role_ids+ accessor, and in the form that edits roles of the user
# the user deselects all roles from +role_ids+ multiple select box, no +role_ids+ parameter is sent. So,
@@ -333,7 +333,6 @@ def options_for_select(container, selected = nil)
disabled_attribute = ' disabled="disabled"' if disabled && option_value_selected?(value, disabled)
%(<option value="#{ERB::Util.html_escape(value)}"#{selected_attribute}#{disabled_attribute}#{html_attributes}>#{ERB::Util.html_escape(text)}</option>)
end.join("\n").html_safe
-
end
# Returns a string of option tags that have been compiled by iterating over the +collection+ and assigning the
@@ -508,9 +507,9 @@ def time_zone_options_for_select(selected = nil, priority_zones = nil, model = :
convert_zones = lambda { |list| list.map { |z| [ z.to_s, z.name ] } }
if priority_zones
- if priority_zones.is_a?(Regexp)
+ if priority_zones.is_a?(Regexp)
priority_zones = model.all.find_all {|z| z =~ priority_zones}
- end
+ end
zone_options += options_for_select(convert_zones[priority_zones], selected)
zone_options += "<option value=\"\" disabled=\"disabled\">-------------</option>\n"
@@ -630,7 +629,7 @@ def select_content_tag(option_tags, options, html_options)
add_default_name_and_id(html_options)
select = content_tag("select", add_options(option_tags, options, value(object)), html_options)
if html_options["multiple"]
- tag("input", :disabled => html_options["disabled"], :name => html_options["name"], :type => "hidden", :value => "") + select
+ tag("input", :disabled => html_options["disabled"], :name => html_options["name"], :type => "hidden", :value => "") + select
else
select
end
View
4 actionpack/lib/action_view/renderer/abstract_renderer.rb
@@ -12,7 +12,7 @@ def render
end
protected
-
+
def extract_details(options)
details = {}
@lookup_context.registered_details.each do |key|
@@ -21,7 +21,7 @@ def extract_details(options)
end
details
end
-
+
def instrument(name, options={})
ActiveSupport::Notifications.instrument("render_#{name}.action_view", options){ yield }
end

0 comments on commit 2e487bc

Please sign in to comment.