Skip to content

Commit

Permalink
forget about the --no-context flag. "generators are learning tools" ...
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed May 11, 2020
1 parent 538fcd3 commit 2b23d78
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 258 deletions.
27 changes: 19 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ Run the following command:


This example aimed at _anyone_ building a Phoenix App
who wants to _automatically_ have a REST API.
For us @dwyl
who wants to _automatically_ have a REST API. <br />
For us [`@dwyl`]()
who are building our API and App Web UI simultaneously,
it serves as a gentle intro to the topic.

Expand Down Expand Up @@ -156,8 +156,9 @@ for more detailed step-by-step introduction to Phoenix:
Once you are comfortable with Phoenix, proceed with this example!


By the end
Our aim is to have two routes
### Is there an _Official_ Way of Doing Content Negotiation?





Expand Down Expand Up @@ -234,12 +235,12 @@ Finished in 0.02 seconds



### 2. Generate `Quotes` Controller, View & Templates
### 2. Generate the `Quotes` Controller, View, Templates and Tests



```
mix phx.gen.html Ctx Quotes quotes author:string text:string tags:string source:string --no-context --no-schema
mix phx.gen.html Ctx Quotes quotes author:string text:string tags:string source:string
```


Expand Down Expand Up @@ -296,10 +297,20 @@ but it still cannot be found, you likely have cyclic module usage in your code



> Before:
[`quotes_controller.ex`](https://github.com/dwyl/phoenix-content-negotiation-tutorial/blob/538fcd3388d8e9a7e4373600b2a33db686d15bc5/lib/app_web/controllers/quotes_controller.ex)
> and
> After:
[`quotes_controller.ex`]()


With tests passing again, let's do a bit of tidying up before proceeding.




With tests passing again, let's do a bit of tidying up.

#### 2.1 Add the Quotes Resources to `lib/app_web/router.ex`
#### 2.3 Add the Quotes Resources to `lib/app_web/router.ex`

Let's follow the instructions to add the resources to `lib/app_web/router.ex`

Expand Down
62 changes: 0 additions & 62 deletions lib/app_web/controllers/quotes_controller.ex

This file was deleted.

5 changes: 0 additions & 5 deletions lib/app_web/templates/quotes/edit.html.eex

This file was deleted.

27 changes: 0 additions & 27 deletions lib/app_web/templates/quotes/form.html.eex

This file was deleted.

32 changes: 0 additions & 32 deletions lib/app_web/templates/quotes/index.html.eex

This file was deleted.

5 changes: 0 additions & 5 deletions lib/app_web/templates/quotes/new.html.eex

This file was deleted.

28 changes: 0 additions & 28 deletions lib/app_web/templates/quotes/show.html.eex

This file was deleted.

3 changes: 0 additions & 3 deletions lib/app_web/views/quotes_view.ex

This file was deleted.

88 changes: 0 additions & 88 deletions test/app_web/controllers/quotes_controller_test.exs

This file was deleted.

0 comments on commit 2b23d78

Please sign in to comment.