aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/asset_tag_helper.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-06-21 06:52:05 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-06-21 06:52:05 +0000
commitbc6570dfcb69cbe9c1435fecb7d5949802c57401 (patch)
treeba63ceaf1616ab0b1c3e7359ed932bf4daad9604 /actionpack/lib/action_view/helpers/asset_tag_helper.rb
parentf2a021dc06d934f569977a05fa4e579e3f593d34 (diff)
downloadrails-bc6570dfcb69cbe9c1435fecb7d5949802c57401.tar.gz
rails-bc6570dfcb69cbe9c1435fecb7d5949802c57401.tar.bz2
rails-bc6570dfcb69cbe9c1435fecb7d5949802c57401.zip
Added tag_options as a third parameter to AssetHelper#auto_discovery_link_tag to control options like the title of the link #1430 [kevin.clark@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1460 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_view/helpers/asset_tag_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/asset_tag_helper.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/helpers/asset_tag_helper.rb b/actionpack/lib/action_view/helpers/asset_tag_helper.rb
index 32244166d2..9970244fb0 100644
--- a/actionpack/lib/action_view/helpers/asset_tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/asset_tag_helper.rb
@@ -14,11 +14,16 @@ module ActionView
# <link rel="alternate" type="application/rss+xml" title="RSS" href="http://www.curenthost.com/controller/action" />
# auto_discovery_link_tag(:atom) # =>
# <link rel="alternate" type="application/atom+xml" title="ATOM" href="http://www.curenthost.com/controller/action" />
- # auto_discovery_link_tag(:rss, :action => "feed") # =>
- # <link rel="alternate" type="application/atom+xml" title="ATOM" href="http://www.curenthost.com/controller/feed" />
- def auto_discovery_link_tag(type = :rss, options = {})
+ # auto_discovery_link_tag(:rss, {:action => "feed"}) # =>
+ # <link rel="alternate" type="application/rss+xml" title="RSS" href="http://www.curenthost.com/controller/feed" />
+ # auto_discovery_link_tag(:rss, {:action => "feed"}, {:title => "My RSS"}) # =>
+ # <link rel="alternate" type="application/rss+xml" title="My RSS" href="http://www.curenthost.com/controller/feed" />
+ def auto_discovery_link_tag(type = :rss, options = {}, tag_options = {})
tag(
- "link", "rel" => "alternate", "type" => "application/#{type}+xml", "title" => type.to_s.upcase,
+ "link",
+ "rel" => tag_options[:rel] || "alternate",
+ "type" => tag_options[:type] || "application/#{type}+xml",
+ "title" => tag_options[:title] || type.to_s.upcase,
"href" => url_for(options.merge(:only_path => false))
)
end