Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion priv/templates/phx.gen.live/index.ex
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ defmodule <%= inspect context.web_module %>.<%= inspect Module.concat(schema.web
{:ok,
socket
|> assign(:page_title, "Listing <%= schema.human_plural %>")<%= if primary_key != :id do %>
|> stream_configure(:<%= schema.collection %>, dom_id: &"<%= schema.table %>-#{&1.<%= primary_key %>}")<% end %>
|> stream_configure(:<%= schema.collection %>, dom_id: &"<%= schema.collection %>-#{&1.<%= primary_key %>}")<% end %>
|> stream(:<%= schema.collection %>, list_<%= schema.plural %>(<%= socket_scope %>))}
end

Expand Down
4 changes: 2 additions & 2 deletions priv/templates/phx.gen.live/live_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ defmodule <%= inspect context.web_module %>.<%= inspect Module.concat(schema.web

assert {:ok, form_live, _html} =
index_live
|> element("#<%= schema.plural %>-#{<%= schema.singular %>.<%= primary_key %>} a", "Edit")
|> element("#<%= schema.collection %>-#{<%= schema.singular %>.<%= primary_key %>} a", "Edit")
|> render_click()
|> follow_redirect(conn, ~p"<%= scope_param_route_prefix %><%= schema.route_prefix %>/#{<%= schema.singular %>}/edit")

Expand All @@ -84,7 +84,7 @@ defmodule <%= inspect context.web_module %>.<%= inspect Module.concat(schema.web
test "deletes <%= schema.singular %> in listing", %{conn: conn, <%= schema.singular %>: <%= schema.singular %><%= test_context_scope %>} do
{:ok, index_live, _html} = live(conn, ~p"<%= scope_param_route_prefix %><%= schema.route_prefix %>")

assert index_live |> element("#<%= schema.plural %>-#{<%= schema.singular %>.<%= primary_key %>} a", "Delete") |> render_click()
assert index_live |> element("#<%= schema.collection %>-#{<%= schema.singular %>.<%= primary_key %>} a", "Delete") |> render_click()
refute has_element?(index_live, "#<%= schema.plural %>-#{<%= schema.singular %>.<%= primary_key %>}")
end
end
Expand Down