diff --git a/app/controllers/maps_controller.rb b/app/controllers/maps_controller.rb index e52b1833..0e59f72d 100644 --- a/app/controllers/maps_controller.rb +++ b/app/controllers/maps_controller.rb @@ -39,7 +39,10 @@ class MapsController < ApplicationController # GET /explore/mine 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 @maps = policy_scope( @@ -54,7 +57,10 @@ class MapsController < ApplicationController # GET /explore/shared 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 @maps = policy_scope( diff --git a/doc/production/first-deploy.md b/doc/production/first-deploy.md index 302ed25f..630ac7ce 100644 --- a/doc/production/first-deploy.md +++ b/doc/production/first-deploy.md @@ -47,10 +47,17 @@ 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 - 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 - 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 variables. @@ -61,8 +68,8 @@ Get an SSL certificate and encrypt it for the realtime video. passenger-config restart-app /home/metamaps/metamaps -If this command fails, it may be helpful for debugging to run a test server to -see what problems show up: +If this command fails, it may be helpful for debugging to run a test +server to see what problems show up: RAILS_ENV=production rails server