         |> put_flash(:info, "User created successfully.")
         |> redirect(to: page_path(conn, :index))
       {:error, changeset} ->
+        roles = Enum.map(Repo.all(Role), fn(x) ->
+          { x.name, x.id }
+        end)
         render(conn, "new.html", changeset: changeset, roles: roles)
     end
   end

        |> put_flash(:info, "User updated successfully.")
        |> redirect(to: user_path(conn, :show, user))
      {:error, changeset} ->
        render(conn, "edit.html", user: user, changeset: changeset, roles: roles)
    end
  end

    end

    changeset = User.changeset(%User{}, user_params)

    case Repo.insert(changeset) do
      {:ok, _user} ->
