Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Error while processing route" with unknown reason

My Goal: emulate nested route, but render it into application outlet.

For example:

/videos - top route

/videos/video001 - nested route

/videos/video001/slide001 - not nested. It is on the same level as /videos.

How I am doing this:

I have following router:

App.Router.map(function () {
    this.resource('videos', { path: '/videos' }, function () {
        this.resource('video', { path: '/:video_id' });
    });

    this.resource('slide', { path: '/videos/:video_id/:slide_id' });
});

To make 'slide' route work as expected I am overriding 'serialize' method, and return 'video_id' and 'slide_id'

And at this point everything seems to be ok. At least page loads as expected.

What is the issue?

When I navigate to "/videos/video001" from "/videos/video001/slide001" via "link-to' helper, I see following error: "Error while processing route: video". And nothing more. I can't understand what kind of error happens and why ember can't process route correctly. However I see that URL has been changed to "/videos/video001".

Any suggestions? How to debug this situation or at least get any useful error message?

UPDATE This article describe exact current situation and gives some solutions: http://hashrocket.com/blog/posts/ember-routing-the-when-and-why-of-nesting

like image 648
pro100sanya Avatar asked Dec 13 '25 03:12

pro100sanya


1 Answers

Ok. I wasn't able to figure out what is the issue, and seems to be nobody able to help with that even on ember irc channel. So I have found interesting article http://hashrocket.com/blog/posts/ember-routing-the-when-and-why-of-nesting and implemented nesting via {into: 'application'}, but to make it work correctly i have overrided renderTemplate hook in all templates to define correct rendering order. And everything works fine.

like image 110
pro100sanya Avatar answered Dec 16 '25 21:12

pro100sanya



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!