Module: Action::ButtonHelper
- Defined in:
- app/helpers/action/button_helper.rb
Instance Method Summary collapse
- #action_button_handle_component_params(kind_key:, color_key:) ⇒ Object
- #action_button_skip_kind(kind_key:, color_key:) ⇒ Object
Instance Method Details
#action_button_handle_component_params(kind_key:, color_key:) ⇒ Object
5 6 7 8 9 10 11 |
# File 'app/helpers/action/button_helper.rb', line 5 def (kind_key:, color_key:) params = { kind: "#{kind_key}", color: "#{color_key}" } params.delete(:color) if color_key == "default" params.compact_blank.filter_map { |k, v| "#{k}: #{v.inspect}" }.join(", ") end |
#action_button_skip_kind(kind_key:, color_key:) ⇒ Object
13 14 15 16 |
# File 'app/helpers/action/button_helper.rb', line 13 def (kind_key:, color_key:) kind_key == "disabled" && color_key != "default" || kind_key == "link" && %w[primary secondary].include?(color_key) end |