instance method after_subscribe

Ruby on Rails 8.1.2

Since v5.2.8.1

Available in: v5.2.8.1 v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

after_subscribe(*methods, &block)

This callback will be triggered after the Base#subscribed method is called, even if the subscription was rejected with the Base#reject method.

To trigger the callback only on successful subscriptions, use the Base#subscription_rejected? method:

after_subscribe :my_method, unless: :subscription_rejected?

Parameters

methods rest
block block
Source
# File actioncable/lib/action_cable/channel/callbacks.rb, line 62
        def after_subscribe(*methods, &block)
          set_callback(:subscribe, :after, *methods, &block)
        end

Defined in actioncable/lib/action_cable/channel/callbacks.rb line 62 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionCable::Channel::Callbacks::ClassMethods

Type at least 2 characters to search.

↑↓ navigate · open · esc close