Question

My current Ember router is using the hash location and I want to switch to using history location. I'm using Rails with thin to serve up the app and hosting on Heroku.

How do I gracefully change the location setting so links that users have bookmarked don't suddenly start breaking?

I saw this solution to edit the .htaccess file, but as far as I can see, Rails doesn't run on top of Apache, so this isn't a solution?

Was it helpful?

Solution

I would recommend doing this client-side. Add something like this to your app:

App = Ember.Application.create({
  ready: function() {
    if (location.hash) {
     //map known hash values to urls, redirect as needed...
    }
  }
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top