app/controllers/application_controller.rb
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception.
For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception . For APIs you may want to use : null_session instead .
def authenticate_admin_user!
		unless signed_in? and (current_user.role.admin or current_user.role.agent)
			flash[:alert] = "No puedes visitar esta página."
			redirect_to root_path
		end
	end
def authenticate_admin_user! unless signed_in? and ( current_user . role . admin or current_user . role . agent ) flash [ :alert ] = "No puedes visitar esta página." redirect_to root_path end end
Prevent CSRF attacks by raising an exception.
Prevent CSRF attacks by raising an exception .