Programming Phoenix LiveView: Path for UserAuthLive and WrongLive modules. (Page 57)

I’m seeing auth/pento/lib/pento_web/live/user_auth_live.ext at the top of the prompt to add this module.

When I started typing this question, I thought I had found an error. Actually, I discovered that I was not following your instructions precisely. This does raise a newbie question:

I get how the top-level of the paths in this chapter is auth (because you happened to create this example project from that auth location), but I had not previously noticed the live after pento_web. I noticed that this matches the path shown on page 56 for the illustration about updating the wrong_live.ex' module--so I went back to Chapter 1 and realized that I had omitted that live` folder when I created the WrongLive module initially.

Nevertheless, my implementation is working (mostly) fine, so my newbie question is: Is this path structure (with live) a convention/idiomatic, or is it a personal choice of the developer–or is it functionally important to LiveView and I just haven’t noticed how my implementation is broken?

Hi @GumptionWare! If your live view was working even without being nested in a live folder, then I’d say that the location of live views in live/ is not technically required. It is however the proper convention and when you generate a Phoenix app with live view, you will see that the live folder is created for you.

1 Like