Rails devise invitable undefined method this -
i using devise invitable in app: user fills form email, creates user in database , sends invitation email address. other person can confirm account setting password. works fine until invited user tries log in setting password. when submits form, error:
undefined local variable or method `this' #
here's invitation controller:
class users::invitationscontroller < devise::invitationscontroller def new @user = user.new end def create @user = user.new @user.save end def update if redirect_to root_path else super end end private # called when creating invitation # should return instance of resource class def invite_resource ## skip sending emails on invite resource_class.invite!(invite_params, current_inviter) |u| u.skip_invitation = true end end # called when accepting invitation # should return instance of resource class def accept_resource resource = resource_class.accept_invitation!(update_resource_params) ## report accepting invitation analytics analytics.report('invite.accept', resource.id) resource end end
what "this" thing ?
Comments
Post a Comment