Skip to content

Commit 3ce8623

Browse files
authored
Starting guides fixes (#6567)
* Small fixes to the "Components and HEEx" guide * Fix "Swapping Databases" link "Using other databases" was moved to "Swapping Databases" in 8da97b3.
1 parent 84c687e commit 3ce8623

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

guides/components.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
> **Requirement**: This guide expects that you have gone through the [request life-cycle guide](request_lifecycle.html).
66
7-
The Phoenix endpoint pipeline takes a request, routes it to a controller, and calls a view module to render a template. The view interface from the controller is simple – the controller calls a view function with the connections assigns, and the function's job is to return a HEEx template. We call any function that accepts an `assigns` parameter and returns a HEEx template a *function component*.
7+
The Phoenix endpoint pipeline takes a request, routes it to a controller, and calls a view module to render a template. The view interface from the controller is simple – the controller calls a view function with the connection's assigns, and the function's job is to return a HEEx template. We call any function that accepts an `assigns` parameter and returns a HEEx template a *function component*.
88

99
> The Phoenix framework is designed for HTML applications, JSON APIs, GraphQL endpoints, etc. For this reason, all of the functionality related to HTML rendering comes as part of two separate packages:
1010
>
@@ -188,7 +188,7 @@ Likewise, for comprehensions may be written as:
188188
189189
In a new Phoenix application, you will also find a `core_components.ex` module inside the `components` folder. This module is a great example of defining function components to be reused throughout our application. This guarantees that, as our application evolves, our components will look consistent.
190190
191-
If you look inside `def html` in `HelloWeb` placed at `lib/hello_web.ex`, you will see that `CoreComponents` are automatically imported into all HTML views via `use HelloWeb, :html`. This is also the reason why `CoreComponents` itself performs `use Phoenix.Component` instead `use HelloWeb, :html` at the top: doing the latter would cause a deadlock as we would try to import `CoreComponents` into itself.
191+
If you look inside `def html` in `HelloWeb` placed at `lib/hello_web.ex`, you will see that `CoreComponents` are automatically imported into all HTML views via `use HelloWeb, :html`. This is also the reason why `CoreComponents` itself performs `use Phoenix.Component` instead of `use HelloWeb, :html` at the top: doing the latter would cause a deadlock as we would try to import `CoreComponents` into itself.
192192
193193
CoreComponents also play an important role in Phoenix code generators, as the code generators assume those components are available in order to quickly scaffold your application. In case you want to learn more about all of these pieces, you may:
194194
@@ -216,7 +216,7 @@ In a newly generated app, the template itself can be found at `lib/hello_web/com
216216
{@inner_content}
217217
```
218218
219-
That's where our templates are injected once they rendered. The root layout is reused by controllers and live views alike.
219+
That's where our templates are injected once they are rendered. The root layout is reused by controllers and live views alike.
220220
221221
Any dynamic functionality of your application is then implemented as function components. For example, your application menu and sidebar is typically part of the `app` component in `lib/hello_web/components/layouts.ex`, which is invoked in every template:
222222

guides/ecto.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Newly generated Phoenix projects include Ecto with the PostgreSQL adapter by def
1616

1717
Ecto also provides support for other databases and it has many learning resources available. Please check out [Ecto's README](https://github.com/elixir-ecto/ecto) for general information.
1818

19-
This guide assumes that we have generated our new application with Ecto integration and that we will be using PostgreSQL. The introductory guides cover how to get your first application up and running. For using other databases, see the [Using other databases](#using-other-databases) section.
19+
This guide assumes that we have generated our new application with Ecto integration and that we will be using PostgreSQL. The introductory guides cover how to get your first application up and running. For using other databases, see the [Swapping Databases](swapping_databases.html) how-to guide.
2020

2121
## Using `phx.gen.schema`
2222

@@ -104,8 +104,8 @@ name | character varying(255) |
104104
email | character varying(255) |
105105
bio | character varying(255) |
106106
number_of_pets | integer |
107-
inserted_at | timestamp(0) without time zone | not null
108-
updated_at | timestamp(0) without time zone | not null
107+
inserted_at | timestamp(0) without time zone | not null
108+
updated_at | timestamp(0) without time zone | not null
109109
Indexes:
110110
"users_pkey" PRIMARY KEY, btree (id)
111111
```

0 commit comments

Comments
 (0)