mirror of https://github.com/rails/rails
Merge pull request #19644 from y-yagi/auto_discovery_link_tag_doc
correct output of auto_discovery_link_tag [ci skip]
This commit is contained in:
commit
0eab204c0e
|
@ -127,7 +127,7 @@ module ActionView
|
||||||
# auto_discovery_link_tag(:rss, {controller: "news", action: "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="RSS" href="http://www.currenthost.com/news/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"})
|
||||||
# # => <link rel="alternate" type="application/rss+xml" title="Example RSS" href="http://www.example.com/feed" />
|
# # => <link rel="alternate" type="application/rss+xml" title="Example RSS" href="http://www.example.com/feed.rss" />
|
||||||
def auto_discovery_link_tag(type = :rss, url_options = {}, tag_options = {})
|
def auto_discovery_link_tag(type = :rss, url_options = {}, tag_options = {})
|
||||||
if !(type == :rss || type == :atom) && tag_options[:type].blank?
|
if !(type == :rss || type == :atom) && tag_options[:type].blank?
|
||||||
raise ArgumentError.new("You should pass :type tag_option key explicitly, because you have passed #{type} type other than :rss or :atom.")
|
raise ArgumentError.new("You should pass :type tag_option key explicitly, because you have passed #{type} type other than :rss or :atom.")
|
||||||
|
|
|
@ -408,7 +408,7 @@ Returns a link tag that browsers and feed readers can use to auto-detect an RSS
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
auto_discovery_link_tag(:rss, "http://www.example.com/feed.rss", { title: "RSS Feed" }) # =>
|
auto_discovery_link_tag(:rss, "http://www.example.com/feed.rss", { title: "RSS Feed" }) # =>
|
||||||
<link rel="alternate" type="application/rss+xml" title="RSS Feed" href="http://www.example.com/feed" />
|
<link rel="alternate" type="application/rss+xml" title="RSS Feed" href="http://www.example.com/feed.rss" />
|
||||||
```
|
```
|
||||||
|
|
||||||
#### image_path
|
#### image_path
|
||||||
|
|
Loading…
Reference in New Issue