Class: Releaf::Builders::ToolboxBuilder

Inherits:
Object
  • Object
show all
Includes:
Base, Resource, Template
Defined in:
app/builders/releaf/builders/toolbox_builder.rb

Instance Attribute Summary

Attributes included from Resource

#resource

Attributes included from Template

#template

Instance Method Summary collapse

Methods included from Resource

#initialize

Methods included from Template

#initialize

Methods included from Base

#default_translation_scope, #html_escape, #icon, #layout_settings, #locale_options, #resource_title, #safe_join, #t, #tag, #template_variable, #translate_locale, #wrapper

Instance Method Details


20
21
22
# File 'app/builders/releaf/builders/toolbox_builder.rb', line 20

def destroy_confirmation_link
  button(t("Delete"), nil, class: %w(ajaxbox danger), href: destroy_confirmation_url, data: {modal: true})
end

#destroy_confirmation_urlObject


24
25
26
# File 'app/builders/releaf/builders/toolbox_builder.rb', line 24

def destroy_confirmation_url
   url_for(action: :confirm_destroy, id: resource.id, index_path: index_path)
end

#itemsObject


14
15
16
17
18
# File 'app/builders/releaf/builders/toolbox_builder.rb', line 14

def items
  list = []
  list << destroy_confirmation_link if feature_available? :destroy
  list
end

#outputObject


6
7
8
9
10
11
12
# File 'app/builders/releaf/builders/toolbox_builder.rb', line 6

def output
  safe_join do
    items.map do |item|
      tag('li', item)
    end
  end
end