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

31 lines
634 B
Ruby
Raw Normal View History

2016-09-24 03:00:46 +00:00
# frozen_string_literal: true
2012-09-23 02:39:12 +00:00
class MainController < ApplicationController
before_action :authorize_main
after_action :verify_authorized
# GET /
def home
2014-08-10 17:06:58 +00:00
respond_to do |format|
2016-09-24 03:00:46 +00: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 15:37:08 +00:00
render 'explore/active'
else
render 'main/home'
2016-09-24 03:00:46 +00:00
end
end
2014-08-10 17:06:58 +00:00
end
end
# GET /request
def requestinvite
end
private
def authorize_main
authorize :Main
end
2012-09-23 02:39:12 +00:00
end