Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • auto_discovery_link_tag in rails

    • 0
    • 1
    • 1
    • 1
    • 0
    • 0
    • 0
    • 0
    • 429
    Comment on it

    Hi guys,
    Today we are going to discuss about auto_discovery_link_tag in rails. It comes under AssetTagHelper, which gives methods for generating HTML that links views to assets(i.e images, JavaScripts, stylesheets, and feeds).
    For consuming RSS and Atom Feeds auto_discovery_link_tag is used. By using this it returns a link tag that is used by the browser and feed readers to auto-detect RSS or atom feed. Its syntax is:

    auto_discovery_link_tag(type = :rss, url_options = {}, tag_options = {}) public

    The options given here are:

    • type: - It can be :rss or :atom. By default it is :rss.
    • url_options: - For controlling the link options in url_for format.
    • tag_options: - It is used for modifying the link_tag. Its available options are:
      • :rel - By default it's alternate, and is used to specify the relation of the link.
      • :type -It is used to override the auto-generated mime type.
      • :title - It specifies the title of the link.


    auto_discovery_link_tag(:rss, "", { title: "FindNerd" }) 
    # =>
    <link rel="alternate" type="application/rss+xml" title="FindNerd" href="" />

    Hope you liked this blog. For more on Rails. Click here

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: