Skip to content

Commit

Permalink
Fixed routeorder "new" have to be before ":id"
Browse files Browse the repository at this point in the history
  • Loading branch information
Juha Halmu committed Sep 1, 2024
1 parent bdab2f4 commit fe30806
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions lib/kotisivut_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ defmodule KotisivutWeb.Router do

scope "/", KotisivutWeb do
pipe_through :browser

get "/", PageController, :home

live "/posts", PostLive.Index, :index
live "/posts/new", PostLive.Index, :new
live "/posts/:id", PostLive.Show, :show
live "/posts/:id/edit", PostLive.Index, :edit
live "/posts/:id/show/edit", PostLive.Show, :edit
get "/", PageController, :home
end

# Other scopes may use custom stacks.
Expand Down Expand Up @@ -71,9 +72,6 @@ defmodule KotisivutWeb.Router do
on_mount: [{KotisivutWeb.UserAuth, :ensure_authenticated}] do
live "/users/settings", UserSettingsLive, :edit
live "/users/settings/confirm_email/:token", UserSettingsLive, :confirm_email
live "/posts/new", PostLive.Index, :new
live "/posts/:id/edit", PostLive.Index, :edit
live "/posts/:id/show/edit", PostLive.Show, :edit
end
end

Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ defmodule Kotisivut.MixProject do
{:phoenix_html, "~> 4.1"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
# TODO bump on release to {:phoenix_live_view, "~> 1.0.0"},
{:phoenix_live_view, "~> 1.0.0-rc.6", override: true},
{:phoenix_live_view, "~> 1.0.0-rc.1", override: true},
{:floki, ">= 0.30.0", only: :test},
{:phoenix_live_dashboard, "~> 0.8.3"},
{:esbuild, "~> 0.8", runtime: Mix.env() == :dev},
Expand Down

0 comments on commit fe30806

Please sign in to comment.