I’m following this tutorial to learn phoenix. However, it seems like the function “html” is missing from stonksLiveWeb_web.ex file and so I’m unable to call this: “use StonksLiveWeb, :html”
defmodule StonksLiveWeb.HelloController do
use StonksLiveWeb, :html
def index(assigns) do
Please advise on how to get around this.
Which version of Phoenix do you use?
:html is for projects generated for Phoenix >= 1.7. Before, that it was
You need to upgrade (phx_new archive in particular) to generate a Phoenix 1.7 project or to follow the guides for the version you actually use.
PS: I don’t really get your mix between controller and view stuffs.
Yes it’s because of a version mismatch. I was following the latest guide for Phx 1.7.2 when my project is at 1.6.2. Hence the confusion. It is resolved thank you for helping.