Class: Frontyard::PageLinks

Inherits:
ApplicationComponent show all
Defined in:
app/components/frontyard/page_links.rb

Instance Method Summary collapse

Methods inherited from ApplicationComponent

#before_template, config, default_config, generate_css_class, #html_options, initialize_with, #namespace, #params, #render_model, #render_table, #view_template

Instance Method Details

#button(text, object, **options) ⇒ Object



12
13
14
15
16
17
18
# File 'app/components/frontyard/page_links.rb', line 12

def button(text, object, **options)
  options = {
    class: "page-button",
    form: {class: "inline-button-form"}
  }.merge(options)
  button_to text, object, **options
end

#dangerous_button(text, object, options) ⇒ Object



20
21
22
23
24
25
# File 'app/components/frontyard/page_links.rb', line 20

def dangerous_button(text, object, options)
  options = {
    class: "page-button dangerous"
  }.merge(options)
  button(text, object, **options)
end


5
6
7
8
9
10
# File 'app/components/frontyard/page_links.rb', line 5

def page_link(text, url, **options)
  options = {
    class: "page-link"
  }.merge(options)
  link_to text, url, **options
end