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

32 lines
635 B
Ruby
Raw Normal View History

2016-09-24 11:00:46 +08:00
# frozen_string_literal: true
2017-11-25 11:23:47 -08:00
2012-09-22 22:39:12 -04:00
class MainController < ApplicationController
before_action :authorize_main
after_action :verify_authorized
# GET /
def home
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?
@maps = policy_scope(Map).where.not(name: 'Untitled Map').where.not(permission: 'private')
.order(updated_at: :desc).page(1).per(20)
2016-09-25 23:37:08 +08:00
render 'explore/active'
else
render 'main/home'
2016-09-24 11:00:46 +08:00
end
end
2014-08-10 13:06:58 -04:00
end
end
# GET /request
def requestinvite
end
private
def authorize_main
authorize :Main
end
2012-09-22 22:39:12 -04:00
end