metamaps--metamaps/app/controllers/main_controller.rb
2016-09-28 22:29:53 +08:00

20 lines
471 B
Ruby

# frozen_string_literal: true
class MainController < ApplicationController
after_action :verify_authorized
after_action :verify_policy_scoped, only: [:home]
# GET /
def home
authorize :Main
respond_to do |format|
format.html do
if !authenticated?
render 'main/home'
else
@maps = policy_scope(Map).order(updated_at: :desc).page(1).per(20)
render 'explore/active'
end
end
end
end
end