-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change the routes configuration to use resources :articles instead of specifying every single route for the Article resource one by one. * Replace per action Article routes with resource in routes config * Update the index view to use the link_to helper for each Article * Update the ArticlesControllerTest to use article_path Completes Rails Getting Started Guide: * 7 CRUDit Where CRUDit Is Due * 7.2 Resourceful Routing
- Loading branch information
1 parent
c2debae
commit 0cc1414
Showing
3 changed files
with
3 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
Rails.application.routes.draw do | ||
root "articles#index" | ||
|
||
get "/articles", to: "articles#index" | ||
get "/articles/:id", to: "articles#show" | ||
resources :articles | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters