Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions installer/lib/phx_new/project.ex
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ defmodule Phx.New.Project do
def new(project_path, opts) do
project_path = Path.expand(project_path)
app = opts[:app] || Path.basename(project_path)

Comment thread
josevalim marked this conversation as resolved.
Outdated
app_mod = Module.concat([opts[:module] || Macro.camelize(app)])

%Project{
Expand Down
12 changes: 12 additions & 0 deletions lib/phoenix/verified_routes.ex
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,18 @@ defmodule Phoenix.VerifiedRoutes do
defp build_route(route_ast, sigil_p, env, endpoint_ctx, router) do
config = Module.get_attribute(env.module, :phoenix_verified_config, [])

if config == [] do
Comment thread
josevalim marked this conversation as resolved.
Outdated
raise ArgumentError, """
attempted to use Phoenix.VerifiedRoutes without calling `use Phoenix.VerifiedRoutes` first.

You must use `use Phoenix.VerifiedRoutes` with the appropriate options instead of importing it:

use Phoenix.VerifiedRoutes, endpoint: MyAppWeb.Endpoint, router: MyAppWeb.Router

See the documentation for more details on configuration options.
"""
end

router =
case Macro.expand(router, env) do
mod when is_atom(mod) ->
Expand Down