Module: Weft::DSL::Triggers::ClassMethods
- Defined in:
- lib/weft/dsl/triggers.rb
Instance Method Summary collapse
-
#trigger_events ⇒ Object
All declared trigger events (own + inherited).
-
#triggers(event_name) ⇒ Object
Declare an event to trigger on all action responses for this component.
Instance Method Details
#trigger_events ⇒ Object
All declared trigger events (own + inherited).
24 25 26 27 28 29 30 |
# File 'lib/weft/dsl/triggers.rb', line 24 def trigger_events if superclass.respond_to?(:trigger_events) superclass.trigger_events | own_triggers else own_triggers.dup end end |
#triggers(event_name) ⇒ Object
Declare an event to trigger on all action responses for this component. Sets the HX-Trigger response header.
triggers "order-updated"
19 20 21 |
# File 'lib/weft/dsl/triggers.rb', line 19 def triggers(event_name) own_triggers << event_name.to_s end |