concept assign in category elixir

This is an excerpt from Manning's book Phoenix in Action.
With that in mind, you also need a different way to specify which route you need to point the form to, and even which HTML action is required! More specifically, you need the form to POST to /items when you’re creating a new item, and to PUT or PATCH to /items/:id when you’re updating an item. The function that renders the template can accept a list of assigns you’d like available in the rendered template, just like in a controller. Knowing that, you can pass the route and action that you need the form to point to through the render function and into the form template.
Let’s first edit the new.html.eex template, so you can see what it looks like to render a template within it. You only need to provide the template name and the assigns you’d like available within the template. The following listing shows what your .../templates/item/new.html.eex template should look like.
Function plugs are good for small tasks, but it’s nice to contain implementations of ideas, like plugs, in their own modules. For that reason, you’ll implement your authentication plug in its own module. This plug should check for the existence of a user_id in the session, and if it’s there, put that user record into the conn as an assign (which you can then access in a template).