Class: TinyAdmin::Views::Components::ActionsButtons
- Inherits:
-
BasicComponent
- Object
- Phlex::HTML
- BasicComponent
- TinyAdmin::Views::Components::ActionsButtons
- Defined in:
- lib/tiny_admin/views/components/actions_buttons.rb
Instance Attribute Summary collapse
-
#actions ⇒ Object
Returns the value of attribute actions.
-
#reference ⇒ Object
Returns the value of attribute reference.
-
#slug ⇒ Object
Returns the value of attribute slug.
Instance Method Summary collapse
Methods included from Attributes
Instance Attribute Details
#actions ⇒ Object
Returns the value of attribute actions.
7 8 9 |
# File 'lib/tiny_admin/views/components/actions_buttons.rb', line 7 def actions @actions end |
#reference ⇒ Object
Returns the value of attribute reference.
7 8 9 |
# File 'lib/tiny_admin/views/components/actions_buttons.rb', line 7 def reference @reference end |
#slug ⇒ Object
Returns the value of attribute slug.
7 8 9 |
# File 'lib/tiny_admin/views/components/actions_buttons.rb', line 7 def slug @slug end |
Instance Method Details
#view_template ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/tiny_admin/views/components/actions_buttons.rb', line 9 def view_template ul(class: "nav justify-content-end") { (actions || {}).each do |action, action_class| li(class: "nav-item mx-1") { href = TinyAdmin.route_for(slug, reference: reference, action: action) a(href: href, class: "nav-link btn btn-outline-secondary") { action_class.respond_to?(:title) ? action_class.title : action } } end } end |