Skip to content

Commit 3a3648b

Browse files
authored
Include maps in the verified routes section of the routing guide (#6274)
1 parent 2d945b8 commit 3a3648b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

guides/routing.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,17 @@ Using `~p` for route paths ensures our application paths and URLs stay up to dat
198198

199199
### More on verified routes
200200

201-
What about paths with query strings? You can either add query string key values directly, or provide a dictionary of key-value pairs, for example:
201+
What about paths with query strings? You can add query string key values directly, as a keyword list or map of values, for example:
202202

203203
```elixir
204204
~p"/users/17?admin=true&active=false"
205205
"/users/17?admin=true&active=false"
206206

207207
~p"/users/17?#{[admin: true]}"
208208
"/users/17?admin=true"
209+
210+
~p"/users/17?#{%{admin: true}}"
211+
"/users/17?admin=true"
209212
```
210213

211214
What if we need a full URL instead of a path? Just wrap your path with a call to `Phoenix.VerifiedRoutes.url/1`, which is imported everywhere that `~p` is available:

0 commit comments

Comments
 (0)