Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Add code from episode 06
This commits the spec, routes, and controller changes from episode 06, which covers refactoring the routes.
- Loading branch information
1 parent
ea8337a
commit 8f9dc32173f1b9a202b25fdeac92aa50732ea955
Showing
7 changed files
with
19 additions
and
11 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
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
@@ -1,4 +1,4 @@ | ||
class StatusController < ApplicationController | ||
class Api::StatusController < ApplicationController | ||
def index | ||
render(json: { 'status' => 'ok' }) | ||
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
@@ -1,6 +1,9 @@ | ||
Rails.application.routes.draw do | ||
get('home' => 'home#index') | ||
root(to: 'home#index') | ||
get('about' => 'about#index') | ||
get('status' => 'status#index') | ||
get('consoles' => 'consoles#index') | ||
|
||
namespace :api do | ||
get('status' => 'status#index') | ||
get('consoles' => 'consoles#index') | ||
end | ||
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
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