Class: Katalyst::Navigation::Button
- Defined in:
- app/models/katalyst/navigation/button.rb
Overview
Renders an HTML button using button_to.
Constant Summary collapse
- HTTP_METHODS =
i[get post patch put delete].index_by(&:itself).freeze
Constants inherited from Item
Instance Attribute Summary
Attributes inherited from Item
#children, #depth, #index, #parent
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Item
Class Method Details
.permitted_params ⇒ Object
14 15 16 |
# File 'app/models/katalyst/navigation/button.rb', line 14 def self.permitted_params super + i[http_method] end |
Instance Method Details
#options_for_target ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'app/models/katalyst/navigation/button.rb', line 18 def = super if target == "_blank" || target == "_top" || target == "self" .deep_merge!({ data: { method: http_method } }) else .deep_merge!({ data: { turbo_method: http_method } }) end end |