diff options
author | Xavier Noria <fxn@hashref.com> | 2016-09-06 18:11:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-06 18:11:21 +0200 |
commit | 1722397f9a63f74bc7ff633895aec7109568a25b (patch) | |
tree | 78c05f68cc5bfe6eeed1eea9f9f68c40518903fb /actionview | |
parent | 2e4eb03925ae5854691a4318787e7707358615e8 (diff) | |
parent | fbccae4d190c91aa689defc2fbf25744b369df05 (diff) | |
download | rails-1722397f9a63f74bc7ff633895aec7109568a25b.tar.gz rails-1722397f9a63f74bc7ff633895aec7109568a25b.tar.bz2 rails-1722397f9a63f74bc7ff633895aec7109568a25b.zip |
Merge pull request #26405 from alexcameron89/case_statement_formatting
Fix Remaining Case-In-Assignment Statement Formatting
Diffstat (limited to 'actionview')
-rw-r--r-- | actionview/lib/action_view/helpers/date_helper.rb | 17 | ||||
-rw-r--r-- | actionview/lib/action_view/helpers/form_tag_helper.rb | 33 |
2 files changed, 26 insertions, 24 deletions
diff --git a/actionview/lib/action_view/helpers/date_helper.rb b/actionview/lib/action_view/helpers/date_helper.rb index c277738920..61ce1d36e0 100644 --- a/actionview/lib/action_view/helpers/date_helper.rb +++ b/actionview/lib/action_view/helpers/date_helper.rb @@ -1026,15 +1026,16 @@ module ActionView # prompt_option_tag(:month, prompt: 'Select month') # => "<option value="">Select month</option>" def prompt_option_tag(type, options) - prompt = case options - when Hash - default_options = { year: false, month: false, day: false, hour: false, minute: false, second: false } - default_options.merge!(options)[type.to_sym] - when String - options + prompt = \ + case options + when Hash + default_options = { year: false, month: false, day: false, hour: false, minute: false, second: false } + default_options.merge!(options)[type.to_sym] + when String + options else - I18n.translate(:"datetime.prompts.#{type}", locale: @options[:locale]) - end + I18n.translate(:"datetime.prompts.#{type}", locale: @options[:locale]) + end prompt ? content_tag("option".freeze, prompt, value: "") : "" end diff --git a/actionview/lib/action_view/helpers/form_tag_helper.rb b/actionview/lib/action_view/helpers/form_tag_helper.rb index a8abe6b7c4..7bd473507b 100644 --- a/actionview/lib/action_view/helpers/form_tag_helper.rb +++ b/actionview/lib/action_view/helpers/form_tag_helper.rb @@ -857,23 +857,24 @@ module ActionView authenticity_token = html_options.delete("authenticity_token") method = html_options.delete("method").to_s.downcase - method_tag = case method - when "get" - html_options["method"] = "get" - "" - when "post", "" - html_options["method"] = "post" - token_tag(authenticity_token, form_options: { - action: html_options["action"], - method: "post" - }) + method_tag = \ + case method + when "get" + html_options["method"] = "get" + "" + when "post", "" + html_options["method"] = "post" + token_tag(authenticity_token, form_options: { + action: html_options["action"], + method: "post" + }) else - html_options["method"] = "post" - method_tag(method) + token_tag(authenticity_token, form_options: { - action: html_options["action"], - method: method - }) - end + html_options["method"] = "post" + method_tag(method) + token_tag(authenticity_token, form_options: { + action: html_options["action"], + method: method + }) + end if html_options.delete("enforce_utf8") { true } utf8_enforcer_tag + method_tag |