diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index 4d7862b811..cb5e692d59 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* 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]
+
* Added option to pass in parameters to CaptureHelper#capture, so you can create more advanced view helper methods #1466 [duane.johnson@gmail.com]. Example:
<% show_calendar(:year => 2005, :month => 6) do |day, options| %>
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
#
# auto_discovery_link_tag(:atom) # =>
#
- # auto_discovery_link_tag(:rss, :action => "feed") # =>
- #
- def auto_discovery_link_tag(type = :rss, options = {})
+ # auto_discovery_link_tag(:rss, {:action => "feed"}) # =>
+ #
+ # auto_discovery_link_tag(:rss, {:action => "feed"}, {:title => "My RSS"}) # =>
+ #
+ 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
diff --git a/actionpack/test/template/asset_tag_helper_test.rb b/actionpack/test/template/asset_tag_helper_test.rb
index b1aa2565b7..045c4b1060 100644
--- a/actionpack/test/template/asset_tag_helper_test.rb
+++ b/actionpack/test/template/asset_tag_helper_test.rb
@@ -27,6 +27,12 @@ class AssetTagHelperTest < Test::Unit::TestCase
%(auto_discovery_link_tag) => %(),
%(auto_discovery_link_tag(:atom)) => %(),
%(auto_discovery_link_tag(:rss, :action => "feed")) => %(),
+ %(auto_discovery_link_tag(:rss, {:action => "feed"}, {:title => "My RSS"})) => %(),
+ %(auto_discovery_link_tag(:rss, {}, {:title => "My RSS"})) => %(),
+ %(auto_discovery_link_tag(nil, {}, {:type => "text/html"})) => %(),
+ %(auto_discovery_link_tag(nil, {}, {:title => "No stream.. really", :type => "text/html"})) => %(),
+ %(auto_discovery_link_tag(:rss, {}, {:title => "My RSS", :type => "text/html"})) => %(),
+ %(auto_discovery_link_tag(:atom, {}, {:rel => "Not so alternate"})) => %(),
}
JavascriptPathToTag = {