phoenixframework / phoenix_html

Building blocks for working with HTML in Phoenix

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incorrect documentation in a forms example(?)

nyaray opened this issue · comments

I don't know if I'm doing something wrong or if I found an error in the docs of phoenix_html 3.2.0. I'm having issues with a form because of CSRF stuff. Well, I'm trying to do what's in the docs (https://hexdocs.pm/phoenix_html/Phoenix.HTML.Form.html#module-with-changeset-data) to let the framework handle CSRF and am getting an unexpected error (well, actually a warning).

The warning I'm getting is

MyApp.Router.Helpers.user_path/2 is undefined or private. Did you mean:

      * page_path/2
      * page_path/3

I've been able to fix the issue by updating my template to call page_path/2 instead.

It's a bit jarring to only get a compile warning (who reads those, anyway, amirite?) and then have the page 500 when accessing the page that presents the form, although I understand why it happens, hehe. I've set warnings as errors in my compile options now, which I'd forgotten to do 😅.

Thank you! Closing in favor of the PR!