home
  • Blog
1.13
  • Getting Started
  • The Object Model
  • Templates
  • Routing
    • Introduction
    • Defining Your Routes
    • Generated Objects
    • Specifying a Route's Model
    • Setting Up a Controller
    • Rendering a Template
    • Redirecting
    • Specifying the URL Type
    • Query Parameters
    • Asynchronous Routing
    • Loading / Error Substates
    • Preventing and Retrying Transitions
  • Components
  • Controllers
  • Models
  • Testing
  • Ember Inspector
  • Configuring Ember.js
  • Understanding Ember.js
  • Contributing to Ember.js
Old Guides - You are viewing the guides for Ember v1.13.0.
Go to v5.0.0

Generated Objects

Edit pencil

As explained in the routing guide, whenever you define a new path in your router, Ember.js attempts to find a corresponding route, controller, and template, each named according to naming conventions. If an implementation of any of these objects is not found, appropriate objects will be generated for you.

Generated routes

Given you have the following route:

app/router.js
Router.map(function() {
  this.route('posts');
});

When you navigate to /posts, Ember.js looks for route:posts. If it doesn't find it, it will automatically generate route:posts for you.

Generated Controllers

If you navigate to route posts, Ember.js looks for a controller called controller:posts. If you did not define it, one will be generated for you.

Generated Templates

A route also expects a template. If you don't provide a template, an empty one will be generated for you.

The empty template includes an {{outlet}}, so nested routes will render correctly even if the route does not explicitly provide a template.

{{outlet}}
left arrow
Defining Your Routes
Specifying a Route's Model
right arrow
On this page

  • Generated routes
  • Generated Controllers
  • Generated Templates
Team Sponsors Security Legal Branding Community Guidelines
Twitter GitHub Discord Mastodon

If you want help you can contact us by email, open an issue, or get realtime help by joining the Ember Discord.

© Copyright 2023 - Tilde Inc.
Ember.js is free, open source and always will be.


Ember is generously supported by
blue