0

I was using this Ember route file to map this URI www.example.com/home/page with the template main-page.hbs located in the home folder

export default {
    resource: 'home',
    path: '/home',
    map() {
        this.route('main-page', { path: 'page' });

    }
};

I was working fine as well until I upgraded my application from 1.2.0 to 2.1.0. I didn't find any difference in two versions with respect to routing in the documentation.Is there any change in routes documentation? Am, I doing something wrong? I am a newbie in Ember js and founding it difficult to understand the routing documentation

Full source code for the plugin is available @ github and I am using the discourse application

Aman Jagga
  • 301
  • 5
  • 15
  • 2
    The file you're showing is a Discourse-specific thing. It's not how routing is done in a plain Ember app, which is probably why the Ember documentation was not helpful to you. – Ed4 Jan 07 '17 at 13:17

1 Answers1

0

Here is an example of the current syntax of the router.js

I'm unsure of the specifics of your situation, but hopefully this will help.

import Ember from 'ember';
import config from './config/environment';

const Router = Ember.Router.extend({
  location: config.locationType,
  rootURL: config.rootURL
});

Router.map(function() {
  // note the implicit 'application' route with {{outlet}}
  this.route('main-page', { path: '/home' ); // or '/' to make it the root
  this.route('rainbow', function() {
    this.route('red');
    this.route('orange');
    // ... nested
  this.route('vampire');
});

export default Router;

https://guides.emberjs.com/v2.1.0/routing/defining-your-routes/

sheriffderek
  • 8,848
  • 6
  • 43
  • 70