source: RedSur/app/controllers/invitation_codes_controller.rb @ 101698b

modelo_minuta
Last change on this file since 101698b was 1b91e02, checked in by aosorio <aosorio@…>, 8 years ago

Version para desarrollo local

  • Property mode set to 100755
File size: 470 bytes
Line 
1class InvitationCodesController < ApplicationController
2  before_action :ensure_valid_invite_code
3
4  rescue_from ActiveRecord::RecordNotFound do
5    redirect_to root_url, :notice => "That invite code is no longer valid"
6  end
7
8  def show 
9    sign_out(current_user) if user_signed_in?
10    redirect_to new_user_registration_path(:invite => {:token => params[:id]})
11  end
12
13  private
14
15  def ensure_valid_invite_code
16    InvitationCode.find_by_token!(params[:id])
17  end
18end
Note: See TracBrowser for help on using the repository browser.