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 = {}, 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 = {}, options = {}, &block) ⇒ Link
Returns a new instance of Link.
80 81 82 83 84 85 86 87 |
# File 'lib/trestle/toolbar/item.rb', line 80 def initialize(template, label, instance_or_url={}, ={}, &block) if instance_or_url.is_a?(Hash) super(template, label, instance_or_url, &block) else super(template, label, , &block) @instance_or_url = instance_or_url end end |
Instance Attribute Details
#instance_or_url ⇒ Object (readonly)
Returns the value of attribute instance_or_url.
78 79 80 |
# File 'lib/trestle/toolbar/item.rb', line 78 def instance_or_url @instance_or_url end |
Instance Method Details
#render ⇒ Object
89 90 91 92 93 94 95 |
# File 'lib/trestle/toolbar/item.rb', line 89 def render if @instance_or_url admin_link_to((label, ), instance_or_url, ) else admin_link_to((label, ), ) end end |