diff --git a/lib/live_beats_web/live/live_helpers.ex b/lib/live_beats_web/live/live_helpers.ex index 2dc8eb5..fbfe704 100644 --- a/lib/live_beats_web/live/live_helpers.ex +++ b/lib/live_beats_web/live/live_helpers.ex @@ -122,13 +122,17 @@ defmodule LiveBeatsWeb.LiveHelpers do """ end - def link(%{navigate: _to} = assigns) do - assigns = assign_new(assigns, :class, fn -> nil end) + def link(%{navigate: to} = assigns) do + opts = + assigns + |> assign_new(:class, fn -> nil end) + |> assigns_to_attributes([:navigate]) + |> Keyword.put(:to, to) + + assigns = assign(assigns, :opts, opts) ~H""" - - <%= render_slot(@inner_block) %> - + <%= live_redirect @opts do %><%= render_slot(@inner_block) %><% end %> """ end