Class: Trestle::Toolbar::Link
Instance Attribute Summary collapse
-
#instance_or_url ⇒ Object
readonly
Returns the value of attribute instance_or_url.
Attributes inherited from Item
Instance Method Summary collapse
-
#initialize(template, label, instance_or_url = nil, **options, &block) ⇒ Link
constructor
A new instance of Link.
- #render ⇒ Object
Methods inherited from Item
#==, #button_classes, #button_label, #button_style, #button_style_classes, #options, #render_menu, #to_s
Constructor Details
#initialize(template, label, instance_or_url = nil, **options, &block) ⇒ Link
Returns a new instance of Link.
79 80 81 82 |
# File 'lib/trestle/toolbar/item.rb', line 79 def initialize(template, label, instance_or_url=nil, **, &block) super(template, label, **, &block) @instance_or_url = instance_or_url end |
Instance Attribute Details
#instance_or_url ⇒ Object (readonly)
Returns the value of attribute instance_or_url.
77 78 79 |
# File 'lib/trestle/toolbar/item.rb', line 77 def instance_or_url @instance_or_url end |
Instance Method Details
#render ⇒ Object
84 85 86 |
# File 'lib/trestle/toolbar/item.rb', line 84 def render admin_link_to((label, ), instance_or_url, **) end |