Provides a set of methods for making easy links and getting urls that depend on the controller and action. This means that you can use the same format for links in the views that you do in the controller. The different methods are even named synchronously, so link_to uses that same url as is generated by url_for, which again is the same url used for redirection in redirect_to.

Methods
Public Instance methods
link_to(name, options = {}, html_options = {})

Creates a link tag of the given name using an URL created by the set of options. See the valid options in classes/ActionController/Base.html#M000021

    # File lib/action_view/helpers/url_helper.rb, line 10
10:       def link_to(name, options = {}, html_options = {})
11:         "<a href='#{url_for(options)}'#{tag_options(html_options)}>#{name}</a>"
12:       end
url_for(options = {})

Returns the URL for the set of options provided. See the valid options in classes/ActionController/Base.html#M000021

    # File lib/action_view/helpers/url_helper.rb, line 15
15:       def url_for(options = {})
16:         @controller.send(:url_for, options)
17:       end
Private Instance methods
tag_options(options_hash)
    # File lib/action_view/helpers/url_helper.rb, line 20
20:         def tag_options(options_hash)
21:           " " + options_hash.collect { |pair| "#{pair.first}=\"#{pair.last}\"" }.sort.join(" ") unless options_hash.empty?
22:         end