title: Map arguments in functions
body: <p>I'm learning elixir and one thing I don't understand the style in which you see maps being arguments in function. The most common place you see this is in controllers like this:</p>
  
  CONTROLLER
  
  <pre><code>def create(conn, %{"league" =&gt; league_params}) do
    league = %League{}
      |&gt; League.changeset(league_params)
      |&gt; Repo.insert()
  
    case league do
      {:ok, league} -&gt;
        conn
        |&gt; put_flash(:info, "League Created Successfully.")
        |&gt; redirect(to: page_path(conn, :index))
      {:error, %Ecto.Changeset{} = changeset} -&gt;
        render(conn, "new.html", changeset: changeset)
    end
  end
  </code></pre>
  
  <p>So, the <code>create/2</code> function. The second argument looks like this <code>%{"league" =&gt; league_params}</code>. Correct me if I'm wrong but that is a map, so why do we reference the value below <code>League.changeset(league_params)</code> instead of the key <code>League.changeset("league")</code>? </p>
  
  <p>This may seem like a silly question but I can't figure this one out and I can't find docs for this question. Thanks for the help.</p>