make requestinvite controller method explicit

This commit is contained in:
Devin Howard 2016-09-26 01:04:58 +08:00
parent c1acaba941
commit 9699b41159
2 changed files with 15 additions and 1 deletions

View file

@ -1,11 +1,11 @@
# frozen_string_literal: true # frozen_string_literal: true
class MainController < ApplicationController class MainController < ApplicationController
before_action :authorize_main
after_action :verify_authorized after_action :verify_authorized
after_action :verify_policy_scoped, only: [:home] after_action :verify_policy_scoped, only: [:home]
# GET / # GET /
def home def home
authorize :Main
respond_to do |format| respond_to do |format|
format.html do format.html do
if !authenticated? if !authenticated?
@ -17,4 +17,14 @@ class MainController < ApplicationController
end end
end end
end end
# GET /request
def requestinvite
end
private
def authorize_main
authorize :Main
end
end end

View file

@ -3,4 +3,8 @@ class MainPolicy < ApplicationPolicy
def home? def home?
true true
end end
def requestinvite?
true
end
end end