aboutsummaryrefslogtreecommitdiffstats
path: root/actionview
diff options
context:
space:
mode:
authorschneems <richard.schneeman@gmail.com>2016-08-18 15:24:20 -0500
committerschneems <richard.schneeman@gmail.com>2016-08-29 13:16:07 -0500
commita22164a282b013e1b3305ea457b84656fba12c2e (patch)
tree8389ac0096d6af11ab6f0815785277c6206a1c8e /actionview
parent9b22681cfc6b98343a8de0fbc0e2527aa688f36a (diff)
downloadrails-a22164a282b013e1b3305ea457b84656fba12c2e.tar.gz
rails-a22164a282b013e1b3305ea457b84656fba12c2e.tar.bz2
rails-a22164a282b013e1b3305ea457b84656fba12c2e.zip
Fix formatting
Diffstat (limited to 'actionview')
-rw-r--r--actionview/lib/action_view/helpers/asset_tag_helper.rb16
-rw-r--r--actionview/lib/action_view/helpers/asset_url_helper.rb29
2 files changed, 22 insertions, 23 deletions
diff --git a/actionview/lib/action_view/helpers/asset_tag_helper.rb b/actionview/lib/action_view/helpers/asset_tag_helper.rb
index 3a83701ef3..2e31bfbc9a 100644
--- a/actionview/lib/action_view/helpers/asset_tag_helper.rb
+++ b/actionview/lib/action_view/helpers/asset_tag_helper.rb
@@ -186,17 +186,17 @@ module ActionView
# favicon_link_tag 'mb-icon.png', rel: 'apple-touch-icon', type: 'image/png'
# # => <link href="/assets/mb-icon.png" rel="apple-touch-icon" type="image/png" />
def favicon_link_tag(source="favicon.ico", options={})
- tag('link', {
+ tag("link", {
rel: "shortcut icon",
type: "image/x-icon",
- href: path_to_image(source, { public_folder: options.delete(:public_folder) })
+ href: path_to_image(source, public_folder: options.delete(:public_folder))
}.merge!(options.symbolize_keys))
end
# Returns a link tag for a favicon asset in the public
# folder. This uses +favicon_link_tag+ and skips any asset
# lookups by assuming any assets are in the `public` folder.
- def public_favicon_link_tag(source='favicon.ico', options={})
+ def public_favicon_link_tag(source="favicon.ico", options={})
favicon_link_tag(source, { public_folder: true }.merge!(options))
end
@@ -234,7 +234,7 @@ module ActionView
options = options.symbolize_keys
check_for_image_tag_errors(options)
- src = options[:src] = path_to_image(source, { public_folder: options.delete(:public_folder) })
+ src = options[:src] = path_to_image(source, public_folder: options.delete(:public_folder))
unless src.start_with?("cid:") || src.start_with?("data:") || src.blank?
options[:alt] = options.fetch(:alt) { image_alt(src) }
@@ -315,7 +315,7 @@ module ActionView
public_poster_folder = options.delete(:public_poster_folder)
sources << options
multiple_sources_tag("video", sources) do |options|
- options[:poster] = path_to_image(options[:poster], { public_folder: public_poster_folder }) if options[:poster]
+ options[:poster] = path_to_image(options[:poster], public_folder: public_poster_folder) if options[:poster]
options[:width], options[:height] = extract_dimensions(options.delete(:size)) if options[:size]
end
end
@@ -325,7 +325,7 @@ module ActionView
# lookups by assuming any assets are in the `public` folder.
def public_video_tag(*sources)
options = sources.extract_options!
- video_tag(*sources, { public_folder: true , public_poster_folder: true}.merge!(options))
+ video_tag(*sources, { public_folder: true , public_poster_folder: true }.merge!(options))
end
# Returns an HTML audio tag for the +source+.
@@ -361,10 +361,10 @@ module ActionView
if sources.size > 1
content_tag(type, options) do
- safe_join sources.map { |source| tag("source", src: send("path_to_#{type}", source, { public_folder: public_folder })) }
+ safe_join sources.map { |source| tag("source", src: send("path_to_#{type}", source, public_folder: public_folder)) }
end
else
- options[:src] = send("path_to_#{type}", sources.first, { public_folder: public_folder })
+ options[:src] = send("path_to_#{type}", sources.first, public_folder: public_folder)
content_tag(type, nil, options)
end
end
diff --git a/actionview/lib/action_view/helpers/asset_url_helper.rb b/actionview/lib/action_view/helpers/asset_url_helper.rb
index 26ba955f07..a21536dd9d 100644
--- a/actionview/lib/action_view/helpers/asset_url_helper.rb
+++ b/actionview/lib/action_view/helpers/asset_url_helper.rb
@@ -167,12 +167,11 @@ module ActionView
end
alias_method :path_to_asset, :asset_path # aliased to avoid conflicts with an asset_path named route
-
# Computes the path to an asset in the public folder.
# This uses +asset_path+ and skips any asset lookups by assuming the asset is in the
# `public` folder.
def public_asset_path(source, options = {})
- path_to_asset(source, {public_folder: true}.merge!(options))
+ path_to_asset(source, { public_folder: true }.merge!(options))
end
alias_method :path_to_public_asset, :public_asset_path # aliased to avoid conflicts with an public_asset_path named route
@@ -195,7 +194,7 @@ module ActionView
# This uses +asset_url+ and skips any asset lookups by assuming the asset is in the
# `public` folder.
def public_asset_url(source, options = {})
- url_to_asset(source, {public_folder: true}.merge!(options))
+ url_to_asset(source, { public_folder: true }.merge!(options))
end
alias_method :path_to_public_asset, :public_asset_path # aliased to avoid conflicts with a public_asset_path named route
@@ -289,7 +288,7 @@ module ActionView
# This uses +javascript_path+ and skips any asset lookups by assuming the asset is in the
# `public` folder.
def public_javascript_path(source, options = {})
- path_to_javascript(source, {public_folder: true}.merge!(options))
+ path_to_javascript(source, { public_folder: true }.merge!(options))
end
alias_method :path_to_public_javascript, :public_javascript_path # aliased to avoid conflicts with a public_javascript_path named route
@@ -309,7 +308,7 @@ module ActionView
# This uses +javascript_url+ and skips any asset lookups by assuming the asset is in the
# `public` folder.
def public_javascript_url(source, options = {})
- url_to_javascript(source, {public_folder: true}.merge!(options))
+ url_to_javascript(source, { public_folder: true }.merge!(options))
end
alias_method :path_to_public_javascript, :public_javascript_path # aliased to avoid conflicts with a public_javascript_path named route
@@ -332,7 +331,7 @@ module ActionView
# This uses +stylesheet_path+ and skips any asset lookups by assuming the asset is in the
# `public` folder.
def public_stylesheet_path(source, options = {})
- path_to_stylesheet(source, {public_folder: true}.merge!(options))
+ path_to_stylesheet(source, { public_folder: true }.merge!(options))
end
alias_method :path_to_public_stylesheet, :public_stylesheet_path # aliased to avoid conflicts with a public_stylesheet_path named route
@@ -352,7 +351,7 @@ module ActionView
# This uses +stylesheet_url+ and skips any asset lookups by assuming the asset is in the
# `public` folder.
def public_stylesheet_url(source, options = {})
- url_to_stylesheet(source, {public_folder: true}.merge!(options))
+ url_to_stylesheet(source, { public_folder: true }.merge!(options))
end
alias_method :path_to_public_stylesheet, :public_stylesheet_path # aliased to avoid conflicts with a public_stylesheet_path named route
@@ -378,7 +377,7 @@ module ActionView
# This uses +image_path+ and skips any asset lookups by assuming the asset is in the
# `public` folder.
def public_image_path(source, options = {})
- path_to_image(source, {public_folder: true}.merge!(options))
+ path_to_image(source, { public_folder: true }.merge!(options))
end
alias_method :path_to_public_image, :public_image_path # aliased to avoid conflicts with a public_image_path named route
@@ -398,7 +397,7 @@ module ActionView
# This uses +image_url+ and skips any asset lookups by assuming the asset is in the
# `public` folder.
def public_image_url(source, options = {})
- url_to_image(source, {public_folder: true}.merge!(options))
+ url_to_image(source, { public_folder: true }.merge!(options))
end
alias_method :path_to_public_image, :public_image_path # aliased to avoid conflicts with a public_image_path named route
@@ -420,7 +419,7 @@ module ActionView
# This uses +video_path+ and skips any asset lookups by assuming the asset is in the
# `public` folder.
def public_video_path(source, options = {})
- path_to_video(source, {public_folder: true}.merge!(options))
+ path_to_video(source, { public_folder: true }.merge!(options))
end
alias_method :path_to_public_video, :public_video_path # aliased to avoid conflicts with a public_video_path named route
@@ -440,7 +439,7 @@ module ActionView
# This uses +video_url+ and skips any asset lookups by assuming the asset is in the
# `public` folder.
def public_video_url(source, options = {})
- url_to_video(source, {public_folder: true}.merge!(options))
+ url_to_video(source, { public_folder: true }.merge!(options))
end
alias_method :path_to_public_video, :public_video_path # aliased to avoid conflicts with a public_video_path named route
@@ -462,7 +461,7 @@ module ActionView
# This uses +audio_path+ and skips any asset lookups by assuming the asset is in the
# `public` folder.
def public_audio_path(source, options = {})
- path_to_audio(source, {public_folder: true}.merge!(options))
+ path_to_audio(source, { public_folder: true }.merge!(options))
end
alias_method :path_to_public_audio, :public_audio_path # aliased to avoid conflicts with a public_audio_path named route
@@ -482,7 +481,7 @@ module ActionView
# This uses +audio_url+ and skips any asset lookups by assuming the asset is in the
# `public` folder.
def public_audio_url(source, options = {})
- url_to_audio(source, {public_folder: true}.merge!(options))
+ url_to_audio(source, { public_folder: true }.merge!(options))
end
alias_method :path_to_public_audio, :public_audio_path # aliased to avoid conflicts with a public_audio_path named route
@@ -503,7 +502,7 @@ module ActionView
# This uses +font_path+ and skips any asset lookups by assuming the asset is in the
# `public` folder.
def public_font_path(source, options = {})
- path_to_font(source, {public_folder: true}.merge!(options))
+ path_to_font(source, { public_folder: true }.merge!(options))
end
alias_method :path_to_public_font, :public_font_path # aliased to avoid conflicts with a public_font_path named route
@@ -523,7 +522,7 @@ module ActionView
# This uses +font_url+ and skips any asset lookups by assuming the asset is in the
# `public` folder.
def public_font_url(source, options = {})
- url_to_font(source, {public_folder: true}.merge!(options))
+ url_to_font(source, { public_folder: true }.merge!(options))
end
alias_method :path_to_public_font, :public_font_path # aliased to avoid conflicts with a public_font_url named route
end