auto_discovery_link_tag(type = :rss, url_options = {}, tag_options = {})
Instance Public methods
Returns a link tag that browsers and feed readers can use to auto-detect an
RSS or Atom feed. The type
can either be :rss
(default) or :atom
. Control the link options in url_for format
using the url_options
. You can modify the LINK tag itself in
tag_options
.
Options
-
:rel
- Specify the relation of this link, defaults to âalternateâ -
:type
- Override the auto-generated mime type -
:title
- Specify the title of the link, defaults to thetype
Examples
1 2 3 4 5 6 7 8 9 10 11 12 | auto_discovery_link_tag # => <link rel="alternate" type="application/rss+xml" title="RSS" href="http://www.currenthost.com/controller/action" /> auto_discovery_link_tag( :atom ) # => <link rel="alternate" type="application/atom+xml" title="ATOM" href="http://www.currenthost.com/controller/action" /> auto_discovery_link_tag( :rss , {action: "feed" }) # => <link rel="alternate" type="application/rss+xml" title="RSS" href="http://www.currenthost.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.currenthost.com/controller/feed" /> auto_discovery_link_tag( :rss , {controller: "news" , action: "feed" }) # => <link rel="alternate" type="application/rss+xml" title="RSS" href="http://www.currenthost.com/news/feed" /> # => <link rel="alternate" type="application/rss+xml" title="Example RSS" href="http://www.example.com/feed" /> |
Please login to continue.