Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify user message in phx.gen.json #5787

Merged
merged 2 commits into from May 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion guides/mix_tasks.md
Expand Up @@ -154,7 +154,7 @@ $ mix phx.gen.json Blog Post posts title:string content:string
When `mix phx.gen.json` is done creating files, it helpfully tells us that we need to add a line to our router file as well as run our Ecto migrations.

```console
Add the resource to your :api scope in lib/hello_web/router.ex:
Add the resource to the "/api" scope in lib/hello_web/router.ex:

resources "/posts", PostController, except: [:new, :edit]

Expand Down
2 changes: 1 addition & 1 deletion lib/mix/tasks/phx.gen.json.ex
Expand Up @@ -171,7 +171,7 @@ defmodule Mix.Tasks.Phx.Gen.Json do
else
Mix.shell().info("""

Add the resource to your :api scope in #{Mix.Phoenix.web_path(ctx_app)}/router.ex:
Add the resource to the "#{Application.get_env(ctx_app, :generators)[:api_prefix] || "/api"}" scope in #{Mix.Phoenix.web_path(ctx_app)}/router.ex:

resources "/#{schema.plural}", #{inspect(schema.alias)}Controller, except: [:new, :edit]
""")
Expand Down
2 changes: 1 addition & 1 deletion test/mix/tasks/phx.gen.json_test.exs
Expand Up @@ -113,7 +113,7 @@ defmodule Mix.Tasks.Phx.Gen.JsonTest do
[
"""

Add the resource to your :api scope in lib/phoenix_web/router.ex:
Add the resource to the "/api" scope in lib/phoenix_web/router.ex:

resources "/posts", PostController, except: [:new, :edit]
"""
Expand Down