Sha256: 7dc33659d8b1379793a8a926e6882e987d9cb807668bdd616bab60979da69b4c
Contents?: true
Size: 803 Bytes
Versions: 32
Compression:
Stored size: 803 Bytes
Contents
class InvitationsController < ApplicationController before_action :authenticate! before_action :set_invitation! def show redirect_to_organization! if current_user.student_of? @organization end def join current_user.accept_invitation! @invitation current_user.update! user_params current_user.notify! redirect_to_organization! end def authorize_if_private! # This controller must never be authenticated end private def redirect_to_organization! redirect_to Mumukit::Platform.laboratory.organic_url(@organization) end def user_params params.require(:user).permit(:name, :first_name, :last_name, :email) end def set_invitation! @invitation = Invitation.find_by_code params[:code] @organization = @invitation.organization end end
Version data entries
32 entries across 32 versions & 1 rubygems