diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb
index 3464ec523e..668515df59 100644
--- a/actionpack/lib/action_view/base.rb
+++ b/actionpack/lib/action_view/base.rb
@@ -55,7 +55,7 @@ module ActionView #:nodoc:
#
# You can pass local variables to sub templates by using a hash with the variable names as keys and the objects as values:
#
- # <%= render "shared/header", { :headline => "Welcome", :person => person } %>
+ # <%= render "shared/header", { headline: "Welcome", person: person } %>
#
# These can now be accessed in shared/header with:
#
diff --git a/actionpack/lib/action_view/helpers/asset_tag_helper.rb b/actionpack/lib/action_view/helpers/asset_tag_helper.rb
index 31316fcdd9..29a5ccedc1 100644
--- a/actionpack/lib/action_view/helpers/asset_tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/asset_tag_helper.rb
@@ -74,10 +74,10 @@ module ActionView
# stylesheet_link_tag "http://www.example.com/style.css"
# # =>
#
- # stylesheet_link_tag "style", :media => "all"
+ # stylesheet_link_tag "style", media: "all"
# # =>
#
- # stylesheet_link_tag "style", :media => "print"
+ # stylesheet_link_tag "style", media: "print"
# # =>
#
# stylesheet_link_tag "random.styles", "/css/stylish"
@@ -111,13 +111,13 @@ module ActionView
# # =>
# auto_discovery_link_tag(:atom)
# # =>
- # auto_discovery_link_tag(:rss, {:action => "feed"})
+ # auto_discovery_link_tag(:rss, {action: "feed"})
# # =>
- # auto_discovery_link_tag(:rss, {:action => "feed"}, {:title => "My RSS"})
+ # auto_discovery_link_tag(:rss, {action: "feed"}, {title: "My RSS"})
# # =>
- # auto_discovery_link_tag(:rss, {:controller => "news", :action => "feed"})
+ # auto_discovery_link_tag(:rss, {controller: "news", action: "feed"})
# # =>
- # auto_discovery_link_tag(:rss, "http://www.example.com/feed.rss", {:title => "Example RSS"})
+ # auto_discovery_link_tag(:rss, "http://www.example.com/feed.rss", {title: "Example RSS"})
# # =>
def auto_discovery_link_tag(type = :rss, url_options = {}, tag_options = {})
if !(type == :rss || type == :atom) && tag_options[:type].blank?
@@ -157,7 +157,7 @@ module ActionView
# will be used if you add the page to the home screen of an iPod Touch, iPhone, or iPad.
# The following call would generate such a tag:
#
- # <%= favicon_link_tag 'mb-icon.png', :rel => 'apple-touch-icon', :type => 'image/png' %>
+ # <%= favicon_link_tag 'mb-icon.png', rel: 'apple-touch-icon', type: 'image/png' %>
def favicon_link_tag(source='favicon.ico', options={})
tag('link', {
:rel => 'shortcut icon',
@@ -183,13 +183,13 @@ module ActionView
# # =>
# image_tag("icon.png")
# # =>
- # image_tag("icon.png", :size => "16x10", :alt => "Edit Entry")
+ # image_tag("icon.png", size: "16x10", alt: "Edit Entry")
# # =>
- # image_tag("/icons/icon.gif", :size => "16")
+ # image_tag("/icons/icon.gif", size: "16")
# # =>
- # image_tag("/icons/icon.gif", :height => '32', :width => '32')
+ # image_tag("/icons/icon.gif", height: '32', width: '32')
# # =>
- # image_tag("/icons/icon.gif", :class => "menu_icon")
+ # image_tag("/icons/icon.gif", class: "menu_icon")
# # =>
def image_tag(source, options={})
options = options.symbolize_keys
@@ -232,19 +232,19 @@ module ActionView
# # =>
# video_tag("trailer.ogg")
# # =>
- # video_tag("trailer.ogg", :controls => true, :autobuffer => true)
+ # video_tag("trailer.ogg", controls: true, autobuffer: true)
# # =>
- # video_tag("trailer.m4v", :size => "16x10", :poster => "screenshot.png")
+ # video_tag("trailer.m4v", size: "16x10", poster: "screenshot.png")
# # =>
- # video_tag("/trailers/hd.avi", :size => "16x16")
+ # video_tag("/trailers/hd.avi", size: "16x16")
# # =>
- # video_tag("/trailers/hd.avi", :height => '32', :width => '32')
+ # video_tag("/trailers/hd.avi", height: '32', width: '32')
# # =>
# video_tag("trailer.ogg", "trailer.flv")
# # =>
# video_tag(["trailer.ogg", "trailer.flv"])
# # =>
- # video_tag(["trailer.ogg", "trailer.flv"], :size => "160x120")
+ # video_tag(["trailer.ogg", "trailer.flv"], size: "160x120")
# # =>
def video_tag(*sources)
multiple_sources_tag('video', sources) do |options|
@@ -264,7 +264,7 @@ module ActionView
#
# audio_tag("sound.wav") # =>
#
- # audio_tag("sound.wav", :autoplay => true, :controls => true) # =>
+ # audio_tag("sound.wav", autoplay: true, controls: true) # =>
#
# audio_tag("sound.wav", "sound.mid") # =>
#
diff --git a/actionpack/lib/action_view/helpers/atom_feed_helper.rb b/actionpack/lib/action_view/helpers/atom_feed_helper.rb
index f9aa8d7cee..f5ac455208 100644
--- a/actionpack/lib/action_view/helpers/atom_feed_helper.rb
+++ b/actionpack/lib/action_view/helpers/atom_feed_helper.rb
@@ -12,7 +12,7 @@ module ActionView
# config/routes.rb:
# Basecamp::Application.routes.draw do
# resources :posts
- # root :to => "posts#index"
+ # root to: "posts#index"
# end
#
# app/controllers/posts_controller.rb:
@@ -37,7 +37,7 @@ module ActionView
# @posts.each do |post|
# feed.entry(post) do |entry|
# entry.title(post.title)
- # entry.content(post.body, :type => 'html')
+ # entry.content(post.body, type: 'html')
#
# entry.author do |author|
# author.name("DHH")
@@ -69,7 +69,7 @@ module ActionView
# @posts.each do |post|
# feed.entry(post) do |entry|
# entry.title(post.title)
- # entry.content(post.body, :type => 'html')
+ # entry.content(post.body, type: 'html')
# entry.tag!('app:edited', Time.now)
#
# entry.author do |author|
@@ -80,11 +80,11 @@ module ActionView
# end
#
# The Atom spec defines five elements (content rights title subtitle
- # summary) which may directly contain xhtml content if :type => 'xhtml'
+ # summary) which may directly contain xhtml content if type: 'xhtml'
# is specified as an attribute. If so, this helper will take care of
# the enclosing div and xhtml namespace declaration. Example usage:
#
- # entry.summary :type => 'xhtml' do |xhtml|
+ # entry.summary type: 'xhtml' do |xhtml|
# xhtml.p pluralize(order.line_items.count, "line item")
# xhtml.p "Shipped to #{order.address}"
# xhtml.p "Paid by #{order.pay_type}"
@@ -149,7 +149,7 @@ module ActionView
# True if the method name matches one of the five elements defined
# in the Atom spec as potentially containing XHTML content and
- # if :type => 'xhtml' is, in fact, specified.
+ # if type: 'xhtml' is, in fact, specified.
def xhtml_block?(method, arguments)
if XHTML_TAG_NAMES.include?(method.to_s)
last = arguments.last
diff --git a/actionpack/lib/action_view/helpers/capture_helper.rb b/actionpack/lib/action_view/helpers/capture_helper.rb
index c98101a195..85e398e559 100644
--- a/actionpack/lib/action_view/helpers/capture_helper.rb
+++ b/actionpack/lib/action_view/helpers/capture_helper.rb
@@ -99,7 +99,7 @@ module ActionView
#
# Then, in another view, you could to do something like this:
#
- # <%= link_to 'Logout', :action => 'logout', :remote => true %>
+ # <%= link_to 'Logout', action: 'logout', remote: true %>
#
# <% content_for :script do %>
# <%= javascript_include_tag :defaults %>
@@ -112,13 +112,13 @@ module ActionView
# identifier in order. For example:
#
# <% content_for :navigation do %>
- #
<%= link_to 'Home', :action => 'index' %>
+ #
<%= link_to 'Home', action: 'index' %>
# <% end %>
#
# <%# Add some other content, or use a different template: %>
#
# <% content_for :navigation do %>
- #
<%= link_to 'Login', :action => 'login' %>
+ #
<%= link_to 'Login', action: 'login' %>
# <% end %>
#
# Then, in another template or layout, this code would render both links in order:
@@ -128,13 +128,13 @@ module ActionView
# If the flush parameter is true content_for replaces the blocks it is given. For example:
#
# <% content_for :navigation do %>
- #
<%= link_to 'Home', :action => 'index' %>
+ #
<%= link_to 'Home', action: 'index' %>
# <% end %>
#
# <%# Add some other content, or use a different template: %>
#
# <% content_for :navigation, flush: true do %>
- #
<%= link_to 'Login', :action => 'login' %>
+ #
<%= link_to 'Login', action: 'login' %>
# <% end %>
#
# Then, in another template or layout, this code would render only the last link:
diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb
index f43d20c6ed..77d8794b7d 100644
--- a/actionpack/lib/action_view/helpers/date_helper.rb
+++ b/actionpack/lib/action_view/helpers/date_helper.rb
@@ -19,7 +19,7 @@ module ActionView
# of \date[month].
module DateHelper
# Reports the approximate distance in time between two Time, Date or DateTime objects or integers as seconds.
- # Pass :include_seconds => true if you want more detailed approximations when distance < 1 min, 29 secs.
+ # Pass include_seconds: true if you want more detailed approximations when distance < 1 min, 29 secs.
# Distances are reported based on the following table:
#
# 0 <-> 29 secs # => less than a minute
@@ -37,7 +37,7 @@ module ActionView
# 1 yr, 9 months <-> 2 yr minus 1 sec # => almost 2 years
# 2 yrs <-> max time or date # => (same rules as 1 yr)
#
- # With :include_seconds => true and the difference < 1 minute 29 seconds:
+ # With include_seconds: true and the difference < 1 minute 29 seconds:
# 0-4 secs # => less than 5 seconds
# 5-9 secs # => less than 10 seconds
# 10-19 secs # => less than 20 seconds
@@ -50,19 +50,19 @@ module ActionView
# distance_of_time_in_words(from_time, from_time + 50.minutes) # => about 1 hour
# distance_of_time_in_words(from_time, 50.minutes.from_now) # => about 1 hour
# distance_of_time_in_words(from_time, from_time + 15.seconds) # => less than a minute
- # distance_of_time_in_words(from_time, from_time + 15.seconds, :include_seconds => true) # => less than 20 seconds
+ # distance_of_time_in_words(from_time, from_time + 15.seconds, include_seconds: true) # => less than 20 seconds
# distance_of_time_in_words(from_time, 3.years.from_now) # => about 3 years
# distance_of_time_in_words(from_time, from_time + 60.hours) # => 3 days
- # distance_of_time_in_words(from_time, from_time + 45.seconds, :include_seconds => true) # => less than a minute
- # distance_of_time_in_words(from_time, from_time - 45.seconds, :include_seconds => true) # => less than a minute
+ # distance_of_time_in_words(from_time, from_time + 45.seconds, include_seconds: true) # => less than a minute
+ # distance_of_time_in_words(from_time, from_time - 45.seconds, include_seconds: true) # => less than a minute
# distance_of_time_in_words(from_time, 76.seconds.from_now) # => 1 minute
# distance_of_time_in_words(from_time, from_time + 1.year + 3.days) # => about 1 year
# distance_of_time_in_words(from_time, from_time + 3.years + 6.months) # => over 3 years
# distance_of_time_in_words(from_time, from_time + 4.years + 9.days + 30.minutes + 5.seconds) # => about 4 years
#
# to_time = Time.now + 6.years + 19.days
- # distance_of_time_in_words(from_time, to_time, :include_seconds => true) # => about 6 years
- # distance_of_time_in_words(to_time, from_time, :include_seconds => true) # => about 6 years
+ # distance_of_time_in_words(from_time, to_time, include_seconds: true) # => about 6 years
+ # distance_of_time_in_words(to_time, from_time, include_seconds: true) # => about 6 years
# distance_of_time_in_words(Time.now, Time.now) # => less than a minute
def distance_of_time_in_words(from_time, to_time = 0, include_seconds_or_options = {}, options = {})
if include_seconds_or_options.is_a?(Hash)
@@ -147,7 +147,7 @@ module ActionView
# time_ago_in_words(3.minutes.ago) # => 3 minutes
# time_ago_in_words(Time.now - 15.hours) # => about 15 hours
# time_ago_in_words(Time.now) # => less than a minute
- # time_ago_in_words(Time.now, :include_seconds => true) # => less than 5 seconds
+ # time_ago_in_words(Time.now, include_seconds: true) # => less than 5 seconds
#
# from_time = Time.now - 3.days - 14.minutes - 25.seconds
# time_ago_in_words(from_time) # => 3 days
@@ -190,7 +190,7 @@ module ActionView
# as a hidden field instead of showing a select field.
# * :order - Set to an array containing :day, :month and :year to
# customize the order in which the select fields are shown. If you leave out any of the symbols, the respective
- # select will not be shown (like when you set :discard_xxx => true. Defaults to the order defined in
+ # select will not be shown (like when you set discard_xxx: true. Defaults to the order defined in
# the respective locale (e.g. [:year, :month, :day] in the en locale that ships with Rails).
# * :include_blank - Include a blank option in every select field so it's possible to set empty
# dates.
@@ -212,36 +212,36 @@ module ActionView
#
# # Generates a date select that when POSTed is stored in the article variable, in the written_on attribute,
# # with the year in the year drop down box starting at 1995.
- # date_select("article", "written_on", :start_year => 1995)
+ # date_select("article", "written_on", start_year: 1995)
#
# # Generates a date select that when POSTed is stored in the article variable, in the written_on attribute,
# # with the year in the year drop down box starting at 1995, numbers used for months instead of words,
# # and without a day select box.
- # date_select("article", "written_on", :start_year => 1995, :use_month_numbers => true,
- # :discard_day => true, :include_blank => true)
+ # date_select("article", "written_on", start_year: 1995, use_month_numbers: true,
+ # discard_day: true, include_blank: true)
#
# # Generates a date select that when POSTed is stored in the article variable, in the written_on attribute,
# # with two digit numbers used for months and days.
- # date_select("article", "written_on", :use_two_digit_numbers => true)
+ # date_select("article", "written_on", use_two_digit_numbers: true)
#
# # Generates a date select that when POSTed is stored in the article variable, in the written_on attribute
# # with the fields ordered as day, month, year rather than month, day, year.
- # date_select("article", "written_on", :order => [:day, :month, :year])
+ # date_select("article", "written_on", order: [:day, :month, :year])
#
# # Generates a date select that when POSTed is stored in the user variable, in the birthday attribute
# # lacking a year field.
- # date_select("user", "birthday", :order => [:month, :day])
+ # date_select("user", "birthday", order: [:month, :day])
#
# # Generates a date select that when POSTed is stored in the article variable, in the written_on attribute
# # which is initially set to the date 3 days from the current date
- # date_select("article", "written_on", :default => 3.days.from_now)
+ # date_select("article", "written_on", default: 3.days.from_now)
#
# # Generates a date select that when POSTed is stored in the credit_card variable, in the bill_due attribute
# # that will have a default day of 20.
- # date_select("credit_card", "bill_due", :default => { :day => 20 })
+ # date_select("credit_card", "bill_due", default: { day: 20 })
#
# # Generates a date select with custom prompts.
- # date_select("article", "written_on", :prompt => { :day => 'Select day', :month => 'Select month', :year => 'Select year' })
+ # date_select("article", "written_on", prompt: { day: 'Select day', month: 'Select month', year: 'Select year' })
#
# The selects are prepared for multi-parameter assignment to an Active Record object.
#
@@ -267,18 +267,18 @@ module ActionView
#
# # Creates a time select tag with a seconds field that, when POSTed, will be stored in the article variables in
# # the sunrise attribute.
- # time_select("article", "start_time", :include_seconds => true)
+ # time_select("article", "start_time", include_seconds: true)
#
# # You can set the :minute_step to 15 which will give you: 00, 15, 30 and 45.
- # time_select 'game', 'game_time', {:minute_step => 15}
+ # time_select 'game', 'game_time', {minute_step: 15}
#
- # # Creates a time select tag with a custom prompt. Use :prompt => true for generic prompts.
- # time_select("article", "written_on", :prompt => {:hour => 'Choose hour', :minute => 'Choose minute', :second => 'Choose seconds'})
- # time_select("article", "written_on", :prompt => {:hour => true}) # generic prompt for hours
- # time_select("article", "written_on", :prompt => true) # generic prompts for all
+ # # Creates a time select tag with a custom prompt. Use prompt: true for generic prompts.
+ # time_select("article", "written_on", prompt: {hour: 'Choose hour', minute: 'Choose minute', second: 'Choose seconds'})
+ # time_select("article", "written_on", prompt: {hour: true}) # generic prompt for hours
+ # time_select("article", "written_on", prompt: true) # generic prompts for all
#
# # You can set :ampm option to true which will show the hours as: 12 PM, 01 AM .. 11 PM.
- # time_select 'game', 'game_time', {:ampm => true}
+ # time_select 'game', 'game_time', {ampm: true}
#
# The selects are prepared for multi-parameter assignment to an Active Record object.
#
@@ -300,23 +300,23 @@ module ActionView
#
# # Generates a datetime select with a year select that starts at 1995 that, when POSTed, will be stored in the
# # article variable in the written_on attribute.
- # datetime_select("article", "written_on", :start_year => 1995)
+ # datetime_select("article", "written_on", start_year: 1995)
#
# # Generates a datetime select with a default value of 3 days from the current time that, when POSTed, will
# # be stored in the trip variable in the departing attribute.
- # datetime_select("trip", "departing", :default => 3.days.from_now)
+ # datetime_select("trip", "departing", default: 3.days.from_now)
#
# # Generate a datetime select with hours in the AM/PM format
- # datetime_select("article", "written_on", :ampm => true)
+ # datetime_select("article", "written_on", ampm: true)
#
# # Generates a datetime select that discards the type that, when POSTed, will be stored in the article variable
# # as the written_on attribute.
- # datetime_select("article", "written_on", :discard_type => true)
+ # datetime_select("article", "written_on", discard_type: true)
#
- # # Generates a datetime select with a custom prompt. Use :prompt => true for generic prompts.
- # datetime_select("article", "written_on", :prompt => {:day => 'Choose day', :month => 'Choose month', :year => 'Choose year'})
- # datetime_select("article", "written_on", :prompt => {:hour => true}) # generic prompt for hours
- # datetime_select("article", "written_on", :prompt => true) # generic prompts for all
+ # # Generates a datetime select with a custom prompt. Use prompt: true for generic prompts.
+ # datetime_select("article", "written_on", prompt: {day: 'Choose day', month: 'Choose month', year: 'Choose year'})
+ # datetime_select("article", "written_on", prompt: {hour: true}) # generic prompt for hours
+ # datetime_select("article", "written_on", prompt: true) # generic prompts for all
#
# The selects are prepared for multi-parameter assignment to an Active Record object.
def datetime_select(object_name, method, options = {}, html_options = {})
@@ -342,32 +342,32 @@ module ActionView
#
# # Generates a datetime select that defaults to the datetime in my_date_time (four days after today)
# # with the fields ordered year, month, day rather than month, day, year.
- # select_datetime(my_date_time, :order => [:year, :month, :day])
+ # select_datetime(my_date_time, order: [:year, :month, :day])
#
# # Generates a datetime select that defaults to the datetime in my_date_time (four days after today)
# # with a '/' between each date field.
- # select_datetime(my_date_time, :date_separator => '/')
+ # select_datetime(my_date_time, date_separator: '/')
#
# # Generates a datetime select that defaults to the datetime in my_date_time (four days after today)
# # with a date fields separated by '/', time fields separated by '' and the date and time fields
# # separated by a comma (',').
- # select_datetime(my_date_time, :date_separator => '/', :time_separator => '', :datetime_separator => ',')
+ # select_datetime(my_date_time, date_separator: '/', time_separator: '', datetime_separator: ',')
#
# # Generates a datetime select that discards the type of the field and defaults to the datetime in
# # my_date_time (four days after today)
- # select_datetime(my_date_time, :discard_type => true)
+ # select_datetime(my_date_time, discard_type: true)
#
# # Generate a datetime field with hours in the AM/PM format
- # select_datetime(my_date_time, :ampm => true)
+ # select_datetime(my_date_time, ampm: true)
#
# # Generates a datetime select that defaults to the datetime in my_date_time (four days after today)
# # prefixed with 'payday' rather than 'date'
- # select_datetime(my_date_time, :prefix => 'payday')
+ # select_datetime(my_date_time, prefix: 'payday')
#
- # # Generates a datetime select with a custom prompt. Use :prompt => true for generic prompts.
- # select_datetime(my_date_time, :prompt => {:day => 'Choose day', :month => 'Choose month', :year => 'Choose year'})
- # select_datetime(my_date_time, :prompt => {:hour => true}) # generic prompt for hours
- # select_datetime(my_date_time, :prompt => true) # generic prompts for all
+ # # Generates a datetime select with a custom prompt. Use prompt: true for generic prompts.
+ # select_datetime(my_date_time, prompt: {day: 'Choose day', month: 'Choose month', year: 'Choose year'})
+ # select_datetime(my_date_time, prompt: {hour: true}) # generic prompt for hours
+ # select_datetime(my_date_time, prompt: true) # generic prompts for all
def select_datetime(datetime = Time.current, options = {}, html_options = {})
DateTimeSelector.new(datetime, options, html_options).select_datetime
end
@@ -389,24 +389,24 @@ module ActionView
#
# # Generates a date select that defaults to the date in my_date (six days after today)
# # with the fields ordered year, month, day rather than month, day, year.
- # select_date(my_date, :order => [:year, :month, :day])
+ # select_date(my_date, order: [:year, :month, :day])
#
# # Generates a date select that discards the type of the field and defaults to the date in
# # my_date (six days after today).
- # select_date(my_date, :discard_type => true)
+ # select_date(my_date, discard_type: true)
#
# # Generates a date select that defaults to the date in my_date,
# # which has fields separated by '/'.
- # select_date(my_date, :date_separator => '/')
+ # select_date(my_date, date_separator: '/')
#
# # Generates a date select that defaults to the datetime in my_date (six days after today)
# # prefixed with 'payday' rather than 'date'.
- # select_date(my_date, :prefix => 'payday')
+ # select_date(my_date, prefix: 'payday')
#
- # # Generates a date select with a custom prompt. Use :prompt => true for generic prompts.
- # select_date(my_date, :prompt => {:day => 'Choose day', :month => 'Choose month', :year => 'Choose year'})
- # select_date(my_date, :prompt => {:hour => true}) # generic prompt for hours
- # select_date(my_date, :prompt => true) # generic prompts for all
+ # # Generates a date select with a custom prompt. Use prompt: true for generic prompts.
+ # select_date(my_date, prompt: {day: 'Choose day', month: 'Choose month', year: 'Choose year'})
+ # select_date(my_date, prompt: {hour: true}) # generic prompt for hours
+ # select_date(my_date, prompt: true) # generic prompts for all
def select_date(date = Date.current, options = {}, html_options = {})
DateTimeSelector.new(date, options, html_options).select_date
end
@@ -427,26 +427,26 @@ module ActionView
#
# # Generates a time select that defaults to the time in my_time,
# # which has fields separated by ':'.
- # select_time(my_time, :time_separator => ':')
+ # select_time(my_time, time_separator: ':')
#
# # Generates a time select that defaults to the time in my_time,
# # that also includes an input for seconds.
- # select_time(my_time, :include_seconds => true)
+ # select_time(my_time, include_seconds: true)
#
# # Generates a time select that defaults to the time in my_time, that has fields
# # separated by ':' and includes an input for seconds.
- # select_time(my_time, :time_separator => ':', :include_seconds => true)
+ # select_time(my_time, time_separator: ':', include_seconds: true)
#
# # Generate a time select field with hours in the AM/PM format
- # select_time(my_time, :ampm => true)
+ # select_time(my_time, ampm: true)
#
# # Generates a time select field with hours that range from 2 to 14
- # select_time(my_time, :start_hour => 2, :end_hour => 14)
+ # select_time(my_time, start_hour: 2, end_hour: 14)
#
# # Generates a time select with a custom prompt. Use :prompt to true for generic prompts.
- # select_time(my_time, :prompt => {:day => 'Choose day', :month => 'Choose month', :year => 'Choose year'})
- # select_time(my_time, :prompt => {:hour => true}) # generic prompt for hours
- # select_time(my_time, :prompt => true) # generic prompts for all
+ # select_time(my_time, prompt: {day: 'Choose day', month: 'Choose month', year: 'Choose year'})
+ # select_time(my_time, prompt: {hour: true}) # generic prompt for hours
+ # select_time(my_time, prompt: true) # generic prompts for all
def select_time(datetime = Time.current, options = {}, html_options = {})
DateTimeSelector.new(datetime, options, html_options).select_time
end
@@ -465,11 +465,11 @@ module ActionView
#
# # Generates a select field for seconds that defaults to the seconds for the time in my_time
# # that is named 'interval' rather than 'second'.
- # select_second(my_time, :field_name => 'interval')
+ # select_second(my_time, field_name: 'interval')
#
- # # Generates a select field for seconds with a custom prompt. Use :prompt => true for a
+ # # Generates a select field for seconds with a custom prompt. Use prompt: true for a
# # generic prompt.
- # select_second(14, :prompt => 'Choose seconds')
+ # select_second(14, prompt: 'Choose seconds')
def select_second(datetime, options = {}, html_options = {})
DateTimeSelector.new(datetime, options, html_options).select_second
end
@@ -489,11 +489,11 @@ module ActionView
#
# # Generates a select field for minutes that defaults to the minutes for the time in my_time
# # that is named 'moment' rather than 'minute'.
- # select_minute(my_time, :field_name => 'moment')
+ # select_minute(my_time, field_name: 'moment')
#
- # # Generates a select field for minutes with a custom prompt. Use :prompt => true for a
+ # # Generates a select field for minutes with a custom prompt. Use prompt: true for a
# # generic prompt.
- # select_minute(14, :prompt => 'Choose minutes')
+ # select_minute(14, prompt: 'Choose minutes')
def select_minute(datetime, options = {}, html_options = {})
DateTimeSelector.new(datetime, options, html_options).select_minute
end
@@ -512,17 +512,17 @@ module ActionView
#
# # Generates a select field for hours that defaults to the hour for the time in my_time
# # that is named 'stride' rather than 'hour'.
- # select_hour(my_time, :field_name => 'stride')
+ # select_hour(my_time, field_name: 'stride')
#
- # # Generates a select field for hours with a custom prompt. Use :prompt => true for a
+ # # Generates a select field for hours with a custom prompt. Use prompt: true for a
# # generic prompt.
- # select_hour(13, :prompt => 'Choose hour')
+ # select_hour(13, prompt: 'Choose hour')
#
# # Generate a select field for hours in the AM/PM format
- # select_hour(my_time, :ampm => true)
+ # select_hour(my_time, ampm: true)
#
# # Generates a select field that includes options for hours from 2 to 14.
- # select_hour(my_time, :start_hour => 2, :end_hour => 14)
+ # select_hour(my_time, start_hour: 2, end_hour: 14)
def select_hour(datetime, options = {}, html_options = {})
DateTimeSelector.new(datetime, options, html_options).select_hour
end
@@ -541,15 +541,15 @@ module ActionView
# select_day(5)
#
# # Generates a select field for days that defaults to the number given, but displays it with two digits.
- # select_day(5, :use_two_digit_numbers => true)
+ # select_day(5, use_two_digit_numbers: true)
#
# # Generates a select field for days that defaults to the day for the date in my_date
# # that is named 'due' rather than 'day'.
- # select_day(my_time, :field_name => 'due')
+ # select_day(my_time, field_name: 'due')
#
- # # Generates a select field for days with a custom prompt. Use :prompt => true for a
+ # # Generates a select field for days with a custom prompt. Use prompt: true for a
# # generic prompt.
- # select_day(5, :prompt => 'Choose day')
+ # select_day(5, prompt: 'Choose day')
def select_day(date, options = {}, html_options = {})
DateTimeSelector.new(date, options, html_options).select_day
end
@@ -570,31 +570,31 @@ module ActionView
#
# # Generates a select field for months that defaults to the current month that
# # is named "start" rather than "month".
- # select_month(Date.today, :field_name => 'start')
+ # select_month(Date.today, field_name: 'start')
#
# # Generates a select field for months that defaults to the current month that
# # will use keys like "1", "3".
- # select_month(Date.today, :use_month_numbers => true)
+ # select_month(Date.today, use_month_numbers: true)
#
# # Generates a select field for months that defaults to the current month that
# # will use keys like "1 - January", "3 - March".
- # select_month(Date.today, :add_month_numbers => true)
+ # select_month(Date.today, add_month_numbers: true)
#
# # Generates a select field for months that defaults to the current month that
# # will use keys like "Jan", "Mar".
- # select_month(Date.today, :use_short_month => true)
+ # select_month(Date.today, use_short_month: true)
#
# # Generates a select field for months that defaults to the current month that
# # will use keys like "Januar", "Marts."
- # select_month(Date.today, :use_month_names => %w(Januar Februar Marts ...))
+ # select_month(Date.today, use_month_names: %w(Januar Februar Marts ...))
#
# # Generates a select field for months that defaults to the current month that
# # will use keys with two digit numbers like "01", "03".
- # select_month(Date.today, :use_two_digit_numbers => true)
+ # select_month(Date.today, use_two_digit_numbers: true)
#
- # # Generates a select field for months with a custom prompt. Use :prompt => true for a
+ # # Generates a select field for months with a custom prompt. Use prompt: true for a
# # generic prompt.
- # select_month(14, :prompt => 'Choose month')
+ # select_month(14, prompt: 'Choose month')
def select_month(date, options = {}, html_options = {})
DateTimeSelector.new(date, options, html_options).select_month
end
@@ -607,23 +607,23 @@ module ActionView
#
# # Generates a select field for years that defaults to the current year that
# # has ascending year values.
- # select_year(Date.today, :start_year => 1992, :end_year => 2007)
+ # select_year(Date.today, start_year: 1992, end_year: 2007)
#
# # Generates a select field for years that defaults to the current year that
# # is named 'birth' rather than 'year'.
- # select_year(Date.today, :field_name => 'birth')
+ # select_year(Date.today, field_name: 'birth')
#
# # Generates a select field for years that defaults to the current year that
# # has descending year values.
- # select_year(Date.today, :start_year => 2005, :end_year => 1900)
+ # select_year(Date.today, start_year: 2005, end_year: 1900)
#
# # Generates a select field for years that defaults to the year 2006 that
# # has ascending year values.
- # select_year(2006, :start_year => 2000, :end_year => 2010)
+ # select_year(2006, start_year: 2000, end_year: 2010)
#
- # # Generates a select field for years with a custom prompt. Use :prompt => true for a
+ # # Generates a select field for years with a custom prompt. Use prompt: true for a
# # generic prompt.
- # select_year(14, :prompt => 'Choose year')
+ # select_year(14, prompt: 'Choose year')
def select_year(date, options = {}, html_options = {})
DateTimeSelector.new(date, options, html_options).select_year
end
@@ -636,7 +636,7 @@ module ActionView
#
# time_tag Date.yesterday, 'Yesterday' # =>
#
- # time_tag Date.today, :pubdate => true # =>
+ # time_tag Date.today, pubdate: true # =>
#
#
# <%= time_tag Time.now do %>
@@ -893,19 +893,19 @@ module ActionView
end
# Build select option html from date value and options.
- # build_options(15, :start => 1, :end => 31)
+ # build_options(15, start: 1, end: 31)
# => "
#
# ..."
#
- # If :use_two_digit_numbers => true option is passed
- # build_options(15, :start => 1, :end => 31, :use_two_digit_numbers => true)
+ # If use_two_digit_numbers: true option is passed
+ # build_options(15, start: 1, end: 31, use_two_digit_numbers: true)
# => "
#
# ..."
#
# If :step options is passed
- # build_options(15, :start => 1, :end => 31, :step => 2)
+ # build_options(15, start: 1, end: 31, step: 2)
# => "
#
# ..."
@@ -954,7 +954,7 @@ module ActionView
end
# Builds a prompt option tag with supplied options or from default options.
- # prompt_option_tag(:month, :prompt => 'Select month')
+ # prompt_option_tag(:month, prompt: 'Select month')
# => ""
def prompt_option_tag(type, options)
prompt = case options
diff --git a/actionpack/lib/action_view/helpers/debug_helper.rb b/actionpack/lib/action_view/helpers/debug_helper.rb
index d8b92c5cab..d361a69a92 100644
--- a/actionpack/lib/action_view/helpers/debug_helper.rb
+++ b/actionpack/lib/action_view/helpers/debug_helper.rb
@@ -11,7 +11,7 @@ module ActionView
# If the object cannot be converted to YAML using +to_yaml+, +inspect+ will be called instead.
# Useful for inspecting an object at the time of rendering.
#
- # @user = User.new({ :username => 'testing', :password => 'xyz', :age => 42}) %>
+ # @user = User.new({ username: 'testing', password: 'xyz', age: 42}) %>
# debug(@user)
# # =>
#