radar / guides

Guides for Ruby and Elixir and whatever else I feel like
1.52k stars 164 forks source link

Post show route defined incorrectly #48

Closed LBRapid closed 10 years ago

LBRapid commented 10 years ago

You define the route for viewing an individual post like the following:

Blorgh.Router.map ()->
  @resource 'post', path: '/posts/:id'

This route is not incorrect in and of itself, but it won't automatically try to use the find method defined on the post model. For that to happen, it needs to be defined using :post_id rather than :id, like so:

Blorgh.Router.map ()->
  @resource 'post', path: '/posts/:post_id'

More info in the dynamic segments section of the ember routing guide at http://emberjs.com/guides/routing/defining-your-routes/

Otherwise, this is a really awesome guide :+1: Great introduction to another JS framework for me.

LBRapid commented 10 years ago

ignore this, I opened a pull request instead