Browse files

Add blog posts resource route

We add the route, but we don’t just write the simplest code possible to get the test to pass; we “write the code we wish we had.” In this case, we wish we had a resourceful blog posts controller, so we create a resource route, which corresponds to a resourceful controller of the same name..

Rails allows you to "unit test" routes, but for trivial configuration like this, it's fine to let the acceptance test cover it without stepping down to the unit level.

Red: uninitialized constant BlogPostsController

The next error we get is that that controller doesn’t exist.
  • Loading branch information...
CodingItWrong committed Feb 26, 2016
1 parent a5cea8f commit 650c1a5d9598c1d61d17d0172ef01f66b01dfb23
Showing with 1 addition and 0 deletions.
  1. +1 −0 config/routes.rb
@@ -1,2 +1,3 @@
Rails.application.routes.draw do
resources :blog_posts

0 comments on commit 650c1a5

Please sign in to comment.