Module: Flatrack::View::LinkHelper

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

Overview

View helpers to render link tags

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

Creates an HTML link tag

Overloads:

  • #link_to(href, options = {}) ⇒ String

    Creates an html link tag to URL, using the URL as the content of the tag.

    Parameters:

    • href (String)

      the link

    • options (Hash) (defaults to: {})

      html options for the tag

    Returns:

    • (String)
  • #link_to(content, href, options = {}) ⇒ String

    Creates an html link tag to URL, using the provided content as the content of the tag.

    Parameters:

    • content (String)

      the content to be displayed for the link tag

    • href (String)

      the link

    • options (Hash) (defaults to: {})

      html options for the tag

    Returns:

    • (String)
  • #link_to(href, options = {}) { ... } ⇒ String

    Creates an html link tag to URL, using the provided return value of the block as the content of the tag.

    Parameters:

    • href (String)

      the link

    Yields:

    • the content of the tag

    Returns:

    • (String)


33
34
35
36
# File 'lib/flatrack/view/link_helper.rb', line 33

def link_to(*args, &block)
  href, options, block = link_to_options(*args, &block)
  html_tag :a, link_to_tag_options(href, options || {}), &block
end