This commit is contained in:
Devin Howard 2016-10-03 09:04:48 +08:00
parent a4cbcc5a2d
commit 0afa34418b

View file

@ -2,18 +2,17 @@
class MainController < ApplicationController
before_action :authorize_main
after_action :verify_authorized
after_action :verify_policy_scoped, only: [:home]
# GET /
def home
respond_to do |format|
format.html do
if !authenticated?
skip_policy_scope
render 'main/home'
else
@maps = policy_scope(Map.where.not(name: 'Untitled Map')).order(updated_at: :desc).page(1).per(20)
if authenticated?
@maps = policy_scope(Map).where.not(name: 'Untitled Map')
.order(updated_at: :desc).page(1).per(20)
render 'explore/active'
else
render 'main/home'
end
end
end