mardi 22 septembre 2015

Ember-cli-rails routing close to a classic rails app

I have a classic rails app with haml and api part (exemple.com/api/v1/). I'm working on an ember app with ember-cli-rails that I want to be accessible at /front for the moment.

The problem is when I'm reloading it fails. The app go back to haml page or fail to route me correctly.

I checked this issue and try to implement it without success.

My routes.rb have nearly 400 lines. But for the moment the only thing who works is to add on the top of the file

  namespace :front do
    get '/', to: 'front#index'
  end

When I'm going on exemple.com/front is ok. If I click on user list I jump to a page at http://ift.tt/1L2rmjb when I click on a specific user http://ift.tt/1KwYbhN. When I reload

No route matches [GET] "/stores/5282/users"

To avoid failing I added this:

  match 'stores/*path', to: redirect('/front'), via: :all

But it just go back to the index page on my ember app. I've try also

  get 'stores/:all', to: "front#index"

But again no route matches.




Aucun commentaire:

Enregistrer un commentaire