Module: InviteOnlySupport

Extended by:
ActiveSupport::Concern
Defined in:
app/controllers/concerns/invite_only_support.rb

Instance Method Summary collapse

Instance Method Details

#invitationObject



4
5
6
7
8
9
10
11
12
13
14
# File 'app/controllers/concerns/invite_only_support.rb', line 4

def invitation
  return not_found unless invitation_only?
  return not_found unless params[:key].present?
  return not_found unless invitation_keys.include?(params[:key])
  session[:invitation_key] = params[:key]
  if user_signed_in?
    redirect_to 
  else
    redirect_to new_user_registration_path
  end
end

#not_foundObject



16
17
18
# File 'app/controllers/concerns/invite_only_support.rb', line 16

def not_found
  render file: "#{Rails.root}/public/404.html", layout: false, status: :not_found
end