-
Notifications
You must be signed in to change notification settings - Fork 323
How To: Run smashing on a sub path
Smashing 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.
<script type="text/javascript" src="/<sub path>/assets/application.js"></script>
<link rel="stylesheet" href="/<sub path>/assets/application.css">
<link rel="icon" href="/<sub path>/assets/favicon.ico">
In 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
...
Also in 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 http://localhost:3030/<sub path>/<dashboard>
When setting a default dashboard, remember to include the sub path.
set :default_dashboard, '<sub path>/<dashboard>'
- Home
- Dashing Workshop
- Installation
- Widgets
- Configuration
- Security
- Troubleshooting
- Deploying dashboards
- How Tos
- How to: post data to your dashboard and widgets
- How to: Define a data model and store history data to database
- How to: Prevent a job from overlapping with itself
- How to: Send HTML data to your widgets
- How to: Send mysql data to your widgets
- How to: Setup a Graph
- How to: Store data to and display from database
- How to: Update a Dashboard using a spreadsheet
- How to: update dashboard in Django
- How to: Update font awesome fonts from version 3 to 4
- How to: Use New Relic with Dashing
- How to: precompile assets
- Development