Module: ActionView::Helpers::UrlHelper

Defined in:
app/helpers/action_view/helpers/url_helper.rb

Instance Method Summary collapse

Instance Method Details



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/helpers/action_view/helpers/url_helper.rb', line 4

def current_link_to(name = nil, options = nil, html_options = nil, &block)
  html_options, options, name = options, name, block if block_given?
  options ||= {}

  html_options = convert_options_to_data_attributes(options, html_options)

  url = url_for(options)

  if current_page?(url)
    html_options["class"] = "current " + (html_options["class"] || "")
  end

  html_options['href'] ||= url

  (:a, name || url, html_options, &block)
end