Class: Phcmemberspro::ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/phcmemberspro/application_controller.rb

Instance Method Summary collapse

Instance Method Details

#current_userObject



22
23
24
# File 'app/controllers/phcmemberspro/application_controller.rb', line 22

def current_user
	@_current_user ||= AuthRocket::Session.from_token(session[:ar_token]).try(:user)
end

#get_member_profile_infoObject

Grab Member Information



9
10
11
# File 'app/controllers/phcmemberspro/application_controller.rb', line 9

def get_member_profile_info  
	@members_profile_info = Member::Profile.find(params[:profile_id])
end

#membership_infoObject



32
33
34
# File 'app/controllers/phcmemberspro/application_controller.rb', line 32

def membership_info
	AuthRocket::Membership.all(user_id: current_user.id).first
end

#new_login_urlObject



27
28
29
# File 'app/controllers/phcmemberspro/application_controller.rb', line 27

def 
	ENV['AUTHROCKET_LOGIN_URL']
end

#require_userObject

AuthRocket User Helpers



14
15
16
17
18
19
20
# File 'app/controllers/phcmemberspro/application_controller.rb', line 14

def require_user
	unless current_user
		params.permit!
		session[:last_url] = request.get? ? url_for(params) : url_for
		redirect_to 
	end
end