fix activemaps_path url bug (#559)

* fix activemaps_path url bug

* annoying doc updates

* skip policy scope if redirecting an explore page

* lol that would have been dumb
This commit is contained in:
Devin Howard 2016-06-20 08:31:32 +08:00
parent 6e1797183e
commit b72536853f
2 changed files with 19 additions and 6 deletions

View file

@ -39,7 +39,10 @@ class MapsController < ApplicationController
# GET /explore/mine # GET /explore/mine
def mymaps def mymaps
return redirect_to activemaps_url if !authenticated? if !authenticated?
skip_policy_scope
return redirect_to explore_active_path
end
page = params[:page].present? ? params[:page] : 1 page = params[:page].present? ? params[:page] : 1
@maps = policy_scope( @maps = policy_scope(
@ -54,7 +57,10 @@ class MapsController < ApplicationController
# GET /explore/shared # GET /explore/shared
def sharedmaps def sharedmaps
return redirect_to activemaps_url if !authenticated? if !authenticated?
skip_policy_scope
return redirect_to explore_active_path
end
page = params[:page].present? ? params[:page] : 1 page = params[:page].present? ? params[:page] : 1
@maps = policy_scope( @maps = policy_scope(

View file

@ -47,10 +47,17 @@
Run this in the metamaps directory, still as metamaps: Run this in the metamaps directory, still as metamaps:
# fill in DB_* values, and realtime server at least. Change the
# SECRET_KEY_BASE to something new. Ctrl+X to save/exit from nano.
cp .example-env .env cp .example-env .env
nano .env # fill in DB_* values, and realtime server at least. Ctrl+X to save/exit. nano .env
# Set up environment variables in your current session
source .env
export RAILS_ENV=production export RAILS_ENV=production
rake db:setup #create, load schema, seed
# create, load schema, seed
rake db:setup
Now set up nginx - config stored on Linode, including relevant environment Now set up nginx - config stored on Linode, including relevant environment
variables. variables.
@ -61,8 +68,8 @@ Get an SSL certificate and encrypt it for the realtime video.
passenger-config restart-app /home/metamaps/metamaps passenger-config restart-app /home/metamaps/metamaps
If this command fails, it may be helpful for debugging to run a test server to If this command fails, it may be helpful for debugging to run a test
see what problems show up: server to see what problems show up:
RAILS_ENV=production rails server RAILS_ENV=production rails server