title: Argument error in changeset
body: <p>I'm learning the Phoenix framework from the book <code>Programming Phoenix</code> and am stuck with an error I can't seem to understand. Basically, the book is currently at the point of adding a form for creating new users. So when I point the browser to <code>http://localhost:4000/users/new</code> I get the below page (please expand the image):</p>
  
  <p><a href="https://i.stack.imgur.com/0gWRO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0gWRO.png" alt="enter image description here"></a></p>
  
  <p>In the command line output the server says:</p>
  
  <pre><code>[info] GET /users/new
  [debug] Processing by Rumbl.UserController.new/2
    Parameters: %{}
    Pipelines: [:browser]
  [info] Sent 500 in 9ms
  [error] #PID&lt;0.543.0&gt; running Rumbl.Endpoint terminated
  Server: localhost:4000 (http)
  Request: GET /users/new
  ** (exit) an exception was raised:
      ** (ArgumentError) argument error
          :erlang.binary_to_existing_atom("name,", :utf8)
          (ecto) lib/ecto/changeset.ex:402: Ecto.Changeset.process_empty_fields/2
          (elixir) lib/enum.ex:1184: Enum."-map/2-lists^map/1-0-"/2
          (ecto) lib/ecto/changeset.ex:373: Ecto.Changeset.do_cast/7
          (rumbl) web/models/user.ex:15: Rumbl.User.changeset/2
          (rumbl) web/controllers/user_controller.ex:17: Rumbl.UserController.new/2
          (rumbl) web/controllers/user_controller.ex:1: Rumbl.UserController.action/2
          (rumbl) web/controllers/user_controller.ex:1: Rumbl.UserController.phoenix_controller_pipeline/2
          (rumbl) lib/rumbl/endpoint.ex:1: Rumbl.Endpoint.instrument/4
          (rumbl) lib/phoenix/router.ex:261: Rumbl.Router.dispatch/2
          (rumbl) web/router.ex:1: Rumbl.Router.do_call/2
          (rumbl) lib/rumbl/endpoint.ex:1: Rumbl.Endpoint.phoenix_pipeline/1
          (rumbl) lib/plug/debugger.ex:122: Rumbl.Endpoint."call (overridable 3)"/2
          (rumbl) lib/rumbl/endpoint.ex:1: Rumbl.Endpoint.call/2
          (plug) lib/plug/adapters/cowboy/handler.ex:15: Plug.Adapters.Cowboy.Handler.upgrade/4
          (cowboy) src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4
  </code></pre>
  
  <p>Since the error says something like <code>binary_to_existing_atom</code> I thought maybe I had mistyped the parameters or something, but it doesn't seem to be the case.</p>
  
  <p>My model file:</p>
  
  <pre><code>defmodule Rumbl.User do
      use Rumbl.Web, :model
  
      schema "users" do
          field :name, :string
          field :username, :string
          field :password, :string, virtual: true
          field :password_hash, :string
  
          timestamps
      end
  
      def changeset(model, params \\ :invalid) do
          model
          |&gt; cast(params, ~w(name, username), [])
          |&gt; validate_length(:username, min: 1, max: 20)
      end 
  end
  </code></pre>
  
  <p>My migration file:</p>
  
  <pre><code>defmodule Rumbl.Repo.Migrations.CreateUser do
      use Ecto.Migration
  
      def change do
          create table(:users) do
              add :name, :string
              add :username, :string, null: false
              add :password_hash, :string
  
              timestamps
          end
  
          create unique_index(:users, [:username])
      end
  end
  </code></pre>
  
  <p>The controller:</p>
  
  <pre><code>defmodule Rumbl.UserController do
      use Rumbl.Web, :controller
  
      def index(conn, _params) do
          users = Repo.all(Rumbl.User)
          render conn, "index.html", users: users
      end
  
      def show(conn, %{"id" =&gt; id}) do
          user = Repo.get(Rumbl.User, id)
          render conn, "show.html", user: user
      end
  
      alias Rumbl.User
  
      def new(conn, _params) do
          changeset = User.changeset(%User{})
          render conn, "new.html", changeset: changeset 
      end
  end
  </code></pre>
  
  <p>And finally, the template:</p>
  
  <pre><code>&lt;h1&gt;New User&lt;/h1&gt;
  
  &lt;%= form_for @changeset, user_path(@conn, :create), fn f -&gt; %&gt;
      &lt;div class="form-group"&gt;
          &lt;%= text_input f, :name, placeholder: "Username", class: "form-control" %&gt;        
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
          &lt;%= password_input f, :password, placeholder: "Password", class: "form-control" %&gt;        
      &lt;/div&gt;
      &lt;%= submit "Create User", class: "btn btn-primary" %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>Let me know if some other code is also needed. And thanks in advance!</p>