Skip to content
This repository has been archived by the owner on Mar 7, 2018. It is now read-only.

Allow dashing to run on sub-path by using relative urls #209

Merged
merged 1 commit into from
Aug 30, 2013
Merged

Allow dashing to run on sub-path by using relative urls #209

merged 1 commit into from
Aug 30, 2013

Conversation

micpango
Copy link
Contributor

A minor change that solved our only problem with running dashing on a sub-path.

@davefp
Copy link
Contributor

davefp commented Aug 30, 2013

Fixes #206

@davefp
Copy link
Contributor

davefp commented Aug 30, 2013

@micpango While you were looking at this, did you find a workaround for #149?

I'd love to have a wiki page detailing the steps required to get Dashing running on a sub-path. Once this is merged in and the next release goes out, would you be interested in writing one?

davefp added a commit that referenced this pull request Aug 30, 2013
Allow dashing to run on sub-path by using relative urls
@davefp davefp merged commit 69afd2f into Shopify:master Aug 30, 2013
@micpango
Copy link
Contributor Author

micpango commented Sep 2, 2013

Thanks
The workaround for #149 was to override the assets_prefix in config, so I guess the issue can be resolved.

I'll submit a PR with a suggestion to wiki page when the merge is released.

@kevintuhumury
Copy link

@micpango What exactly do you need to do to get Dashing running under a sub-path? I currently get a blank page (I do see the html of the widgets in the source),because it can't find /assets/application.js or /assets/application.css. Also is a subdomain considered a sub-path?

I'm trying to get dashing to run under something like dashing.domain.com. Would I need to use dashing from master and use assets_prefix (asset_prefix: "/dashing/assets/" ?), more than just that or wouldn't that be possible?

I'm using Nginx + Passenger btw.

@micpango
Copy link
Contributor Author

micpango commented Sep 3, 2013

This is for sub-path (e.g. domain.com/dashing/). With sub-domain you will still run your app on "/", so this wouldn't be necessary I guess.

Other than changing the assets_prefix, I also had to override the Batman.config.viewPrefix. I did this in application.coffee.
Then, of course, update the layout with the new assets path.

I use Rack::URLMap for running app on sub-path.

@joscarsson
Copy link

@micpango did you ever find the time to write that wiki post? I would also be interested on how to run this on sub path.

@micpango
Copy link
Contributor Author

@joscarsson Yes, I definitely need to get around to doing that. Will try to have it out by the end of the week.

@micpango
Copy link
Contributor Author

micpango commented Nov 4, 2013

@davefp Finally got around to creating a small wiki page on this one.
https://github.com/Shopify/dashing/wiki/How-To%3A-Run-dashing-on-a-sub-path

@joscarsson
Copy link

Thanks! Great!

@ematthews
Copy link

This is very minor, but I would add this to your page of instructions:

Update images path by editing widgets/image/image.html to:

<img data-bind-src="image | prepend '<sub path>/assets'" data-bind-width="width"/>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants