 
     case ExAdmin.Repo.update(changeset) do
       {:error, changeset} ->
-        conn = put_flash(conn, :inline_error, changeset.errors)
-        contents = do_form_view model, conn,
-          ExAdmin.Changeset.get_data(changeset), params
-        conn |> render("admin.html", html: contents, filters: nil)
+        conn |> handle_changeset_error(changeset, params)
       resource ->
         {conn, _, resource} = handle_after_filter(conn, :update, defn, params, resource)
         put_flash(conn, :notice, "#{base_name model} was successfully updated")

    end
  end

  def create(conn, defn, params) do
    model = defn.__struct__
    resource = conn.assigns.resource


    case ExAdmin.Repo.insert(changeset) do
      {:error, changeset} ->
        conn |> handle_changeset_error(changeset, params)
      resource ->
        {conn, _, resource} = handle_after_filter(conn, :create, defn, params, resource)
        put_flash(conn, :notice, "#{base_name model} was successfully created.")
