xaviershay/enki — pull request #75 by mcary (2013-04-16 12:43:05+00:00)
Title: 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.

---

Here's another little tweak that may not belong within the Enki core. If not, perhaps I can add it to the [list of forks in the wiki](https://github.com/xaviershay/enki/wiki).

(This is not covered by automated tests. Any tips on testing this are welcome.)