Module: Flatrack::View::LinkHelper

Includes:
TagHelper
Included in:
Flatrack::View
Defined in:
lib/flatrack/view/link_helper.rb

Constant Summary

Constants included from TagHelper

TagHelper::BOOLEAN_ATTRIBUTES, TagHelper::PRE_CONTENT_STRINGS

Instance Method Summary collapse

Methods included from TagHelper

#html_tag, #image_tag, #javascript_tag, #stylesheet_tag

Instance Method Details



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/flatrack/view/link_helper.rb', line 6

def link_to(name = nil, options = nil, html_options = nil, &block)
  if block_given?
    href, options, block = name, options, block
  elsif options.is_a?(Hash) || options.blank?
    name, href, options, block = name, name, options, block
  else
    name, href, options, block = name, options, html_options, block
  end

  block ||= proc { name }

  html_tag :a, link_to_options(href, options || {}), &block
end