File tree Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 33require ::File . expand_path ( '../config/environment' , __FILE__ )
44
55# Serve the rails app under a prefix. Defaults to '/achrails'
6- prefix = ENV [ 'RAILS_PREFIX' ] || '/achrails'
7-
6+ prefix = ENV [ 'RAILS_RELATIVE_URL_ROOT' ]
87map prefix do
98 run Rails . application
109end
Original file line number Diff line number Diff line change 66# See: https://github.com/Casecommons/pg_search/issues/144
77require 'pg_search'
88
9+ ENV [ 'RAILS_RELATIVE_URL_ROOT' ] ||= '/achrails'
Original file line number Diff line number Diff line change 1+ # Fix asset paths not being prefixed correctly
2+ # From http://stackoverflow.com/questions/7293918/broken-precompiled-assets-in-rails-3-1-when-deploying-to-a-sub-uri
3+ module Sprockets
4+ module Helpers
5+ module RailsHelper
6+
7+ def asset_path ( source , options = { } )
8+ source = source . logical_path if source . respond_to? ( :logical_path )
9+ path = asset_paths . compute_public_path ( source , asset_prefix , options . merge ( :body => true ) )
10+ path = options [ :body ] ? "#{ path } ?body=1" : path
11+ if !asset_paths . send ( :has_request? )
12+ path = ENV [ 'RAILS_RELATIVE_URL_ROOT' ] + path if ENV [ 'RAILS_RELATIVE_URL_ROOT' ]
13+ end
14+ path
15+ end
16+
17+ end
18+ end
19+ end
You can’t perform that action at this time.
0 commit comments