How To: Run dashing on a sub path
Clone this wiki locally
Dashing runs on root by default. With some small changes we can make it run on a sub path. Be aware that not all of the following changes are required if you are running behind a gateway that will strip part of your path. In such a case html assets will need the sub-path and so will
default_dashboard if you choose to set one.
In the top of your
application.coffee, add the view prefix Dashing should use:
Batman.config.viewPrefix = '<sub path>/views'
Your template in
layout.erb must also be aware of the new path. Add the sub path in the following places.
config.ru you add the sub path as your new assets prefix.
... set :assets_prefix, '/<sub path>/assets' map Sinatra::Application.assets_prefix do run Sinatra::Application.sprockets end ...
config.ru, instead of
run Sinatra::Application to start the application you can use Rack:URLMap
run Rack::URLMap.new('/<sub path>' => Sinatra::Application)
The app will now be running on
When setting a default dashboard, remember to include the sub path.
set :default_dashboard, '<sub path>/<dashboard>'