Sha256: 58c9acfff14a41668aee6f2b0782e61bbcbd887cb034b599962dc7febbf2a5bd
Contents?: true
Size: 1.71 KB
Versions: 2
Compression:
Stored size: 1.71 KB
Contents
class Users::Base::InvitationsController < Devise::InvitationsController # # POST /resource/invitation def create self.resource = invite_resource resource_invited = resource.errors.empty? yield resource if block_given? if resource_invited # if is_flashing_format? && self.resource.invitation_sent_at # set_flash_message :notice, :send_instructions, :email => self.resource.email # end render layout: false, status: 200, locals: { result: true } else render layout: false, status: 301, locals: { result: false } # # respond_with resource, :location => after_invite_path_for(current_inviter) # else # respond_with_navigational(resource) { render :new } end end # def update # if this # redirect_to root_path # else # super # end # end private # this is called when creating invitation # should return an instance of resource class def invite_resource ## skip sending emails on invite resource_class.invite!(resource_params, current_user) do |u| # u.skip_invitation = true end end def resource_params {email: params[:user][:email], name: params[:user][:name], account_id: params[:user][:account_id] } # params.permit(user: [:name, :email,:invitation_token, :your_params_here])[:user] end # this is called when accepting invitation # should return an instance of resource class def accept_resource resource = resource_class.accept_invitation!(update_resource_params) ## Report accepting invitation to analytics # Analytics.report('invite.accept', resource.id) resource end # def after_invite_path_for(usr) # end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
oxen_account-0.1.1 | app/controllers/users/base/invitations_controller.rb |
oxen_account-0.1.0 | app/controllers/users/base/invitations_controller.rb |