-
Notifications
You must be signed in to change notification settings - Fork 151
Devise
Kris Leech edited this page Jun 24, 2014
·
1 revision
Use build_resource
to get access to the user model and subscribe a listener.
class RegistrationsController < Devise::RegistrationsController
def build_resource(sign_up_params)
super.subscribe(RegistrationMailer.new)
end
end
class User < ActiveRecord::Base
include Wisper::Publisher
after_create do
publish(:user_created, self)
end
end
Another option is to globally subscribe a listener meaning you don't need to create a custom devise controller like in the above example.
Need to ask a question? Please ask on StackOverflow tagging the question with wisper.
Found a bug? Please report it on the Issue tracker.