title: assign @changeset not available in eex template
body: <p>I am trying to learn the Phoenix's Form system with including the Ecto.Model's but i have encountered a problem that i can't pass. I have created a form:</p>
  
  <pre><code>&lt;div class="jumbotron"&gt;
    &lt;%= form_for @changeset, user_path(@conn, :create), fn f -&gt; %&gt;
      &lt;label&gt;
        Login: &lt;%= text_input f, :login %&gt;
      &lt;/label&gt;
      &lt;label&gt;
        Password: &lt;%= password_input f, :password %&gt;
      &lt;/label&gt;
      &lt;label&gt;
        Name: &lt;%= text_input f, :name %&gt;
      &lt;/label&gt;
      &lt;label&gt;
        Surname: &lt;%= text_input f, :name %&gt;
      &lt;/label&gt;
      &lt;label&gt;
        Email: &lt;%= email_input f, :name %&gt;
      &lt;/label&gt;
      &lt;label&gt;
        Class: &lt;%= text_input f, :name %&gt;
      &lt;/label&gt;
      &lt;label&gt;
        Phone: &lt;%= text_input f, :name %&gt;
      &lt;/label&gt;
  
      &lt;%= submit "Submit" %&gt;
    &lt;% end %&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>That is being served by Controller:</p>
  
  <pre><code>  def index(conn, _params) do
      changeset = User.changeset(%User{})
      render conn, "index.html", changeset: changeset
    end
  
    def create(conn, _params) do
      IO.inspect(_params)
      render conn, "index.html"
    end
  </code></pre>
  
  <p>And the model:</p>
  
  <pre><code>defmodule Kpsz.Model.User do
    use Kpsz.Web, :model
  
    schema "users" do
      field :login, :string
      field :password, :string
      field :email, :string
  
      field :role, :integer
  
      field :name, :string
      field :surname, :string
      field :class, :string
      field :phone_number, :string
  
      has_many :presences, Kpsz.Model.Presence
    end
  
    @required_fields ~w(login,password,email,name,surname,class,phone_number)
    @optional_fields ~w(role)
  
    def changeset(user, params \\ :empty) do
      case params do
        :empty -&gt; cast(user,params, ~w(),~w())
        _ -&gt; user
          |&gt; cast(params, @required_fields, @optional_fields)
          |&gt; validate_format(:email, ~r/@/)
          |&gt; unique_constraint(:email)
      end
    end
  
  end
  </code></pre>
  
  <p>I have pattern matched the params, because i was getting bunch of errors while creating empty changeset for passing it to the form. Is there any better way around it?</p>
  
  <p>And error I am getting after submiting the form:
  <a href="https://i.stack.imgur.com/JifM3.png" rel="noreferrer"><img src="https://i.stack.imgur.com/JifM3.png" alt="enter image description here"></a></p>
  
  <p>Can anyone point out what I am doing wrong and give some info how to fix it?</p>