문제

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?

도움이 되었습니까?

해결책

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...
    }
  }
});
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top