forked from xaviershay/enki
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow running Enki under a URL path prefix
I run my blog in a subsdirectory of my web server. That is, instead of blog.example.com, I use example.com/blog. Rails 3 no longer supports that as an out-of-the-box configuration option. (There is an action_controller.relative_url_root key, but it doesn't handle asset helper paths or, under some servers, the top-level route rewriting.) Tweak routing and URLs in several places: * config.ru -- addresses most routing * Set RAILS_RELATIVE_URL_ROOT to make asset helpers work * Fix Enki-specific URLs in post_path helper and admin view to work in a non-root-path deployment In config/application.rb, comment an example line that sets RAILS_RELATIVE_URL_ROOT. The line is commented so that the app still runs in "/", but a one-line config change or setting that environment variable would change that.
- Loading branch information
Marcel M. Cary
committed
Apr 16, 2013
1 parent
a43d13c
commit 925cf43
Showing
4 changed files
with
11 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
# This file is used by Rack-based servers to start the application. | ||
|
||
require ::File.expand_path('../config/environment', __FILE__) | ||
run Enki::Application | ||
|
||
map ENV['RAILS_RELATIVE_URL_ROOT'] || "/" do | ||
run Enki::Application | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters