Implementing different views for the same route

Hi all,

I’ve been tinkering around trying to mimic Instgram’s routing behavior with Ember.js but I have not had much success. Let’s stick with Instagram as an example: I’m essentially trying to load an image into a modal if it is accessed directly on the list page; but, if accessed from a url, the image has it’s own page.

URLs for refrence:

To me it appears that they are doing some sort of query params manipulation.

Does any one have any advice?

Anyone tackle this before?

Create a component that you can then use both inside your modal, and on the /:image_id route.

I’d suggest you avoid using query params for that. Use a RESTful route instead.

1 Like

Thanks @gregone, I’ve modularized it into a component! I’m reading up on Rendering a Template - Routing - Ember Guides to try to complete this “widget” now.

Similar topic on stackoverflow Adding route to a modal/overlay in Ember.js - Stack Overflow