style
This commit is contained in:
parent
a4cbcc5a2d
commit
0afa34418b
1 changed files with 5 additions and 6 deletions
|
@ -2,18 +2,17 @@
|
||||||
class MainController < ApplicationController
|
class MainController < ApplicationController
|
||||||
before_action :authorize_main
|
before_action :authorize_main
|
||||||
after_action :verify_authorized
|
after_action :verify_authorized
|
||||||
after_action :verify_policy_scoped, only: [:home]
|
|
||||||
|
|
||||||
# GET /
|
# GET /
|
||||||
def home
|
def home
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html do
|
format.html do
|
||||||
if !authenticated?
|
if authenticated?
|
||||||
skip_policy_scope
|
@maps = policy_scope(Map).where.not(name: 'Untitled Map')
|
||||||
render 'main/home'
|
.order(updated_at: :desc).page(1).per(20)
|
||||||
else
|
|
||||||
@maps = policy_scope(Map.where.not(name: 'Untitled Map')).order(updated_at: :desc).page(1).per(20)
|
|
||||||
render 'explore/active'
|
render 'explore/active'
|
||||||
|
else
|
||||||
|
render 'main/home'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue