Class: DesignSystem::Generic::Builders::Link

Inherits:
Base
  • Object
show all
Defined in:
lib/design_system/generic/builders/link.rb

Overview

This class provides generic methods to display links on html, including button links.

Instance Method Summary collapse

Methods inherited from Base

#initialize

Methods included from Helpers::CssHelper

#css_class_options_merge

Methods included from Concerns::BrandDerivable

#brand

Constructor Details

This class inherits a constructor from DesignSystem::Generic::Builders::Base

Instance Method Details



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/design_system/generic/builders/link.rb', line 8

def render_link_to(name = nil, options = nil, html_options = nil, &)
  options ||= {}
  html_options ||= {}

  if block_given?
    type = options.delete(:type)
    options[:class] = prep_link_classes(type)
  else
    type = html_options.delete(:type)
    html_options[:class] = prep_link_classes(type)
  end

  link_to(name, options, html_options, &)
end