tfwright/live_admin

Phoenix 1.7 - function nil.home_path/2 is undefined

blutack opened this issue · 1 comments

Note, this only affects the branch in #12 as Phoenix 1.7 requires LV 0.18 but I'm putting it here in case that gets merged.

Phoenix 1.7 ships with router helpers disabled by default.

The default layout uses a router helper here:

<%= live_redirect("Home", to: @socket.router.__helpers__().home_path(@socket, :home)) %>

Therefore, with default 1.7 config we get an UndefinedFunctionError.

As a temporary workaround, update myapp_web.ex and change use Phoenix.Router, helpers: false to use Phoenix.Router, helpers: true.

Other than that it seems that everything works well with 1.7!

Thanks for the report! Since this only affects a currently issue though, let's move this discussion there.