metamaps--metamaps/app/controllers/main_controller.rb

21 lines
471 B
Ruby
Raw Normal View History

2016-09-24 11:00:46 +08:00
# frozen_string_literal: true
2012-09-22 22:39:12 -04:00
class MainController < ApplicationController
after_action :verify_authorized
after_action :verify_policy_scoped, only: [:home]
# GET /
def home
authorize :Main
2014-08-10 13:06:58 -04:00
respond_to do |format|
2016-09-24 11:00:46 +08:00
format.html do
if !authenticated?
render 'main/home'
else
@maps = policy_scope(Map).order(updated_at: :desc).page(1).per(20)
2016-09-25 23:37:08 +08:00
render 'explore/active'
2016-09-24 11:00:46 +08:00
end
end
2014-08-10 13:06:58 -04:00
end
end
2012-09-22 22:39:12 -04:00
end