Class: Compony::Components::Buttons::Link
- Inherits:
-
Compony::Component
- Object
- Compony::Component
- Compony::Components::Buttons::Link
- Defined in:
- lib/compony/components/buttons/link.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Compony::Component
#comp_opts, #content_blocks, #parent_comp
Instance Method Summary collapse
- #prepare_opts! ⇒ Object protected
Methods inherited from Compony::Component
#before_render, comp_name, #content, #exposed_intents, family_name, #id, #id_path, #id_path_hash, #initialize, #inspect, #param_name, #path, #remove_content, #remove_content!, #render, #resourceful?, #root_comp, #root_comp?, setup, #sub_comp
Constructor Details
This class inherits a constructor from Compony::Component
Instance Method Details
#prepare_opts! ⇒ Object (protected)
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/compony/components/buttons/link.rb', line 17 def prepare_opts! @label = @comp_opts.delete(:label).presence @href = @comp_opts.delete(:href).presence || 'javascript:void(0)' @method = @comp_opts.delete(:method).presence if @method && @method.to_sym != :get @comp_opts[:data] = { turbo_method: @method }.merge(@comp_opts[:data] || {}) end if @comp_opts[:class]&.split&.include?('disabled') @comp_opts[:style] = 'text-decoration:line-through;cursor: default;color: #6c757d;' end end |