 
     case Repo.insert(changeset) do
       {:ok, door_group} ->
+        save_door_groups door_group, door_group_params
         conn
         |> put_flash(:info, "Door group created successfully.")
         |> redirect(to: door_group_path(conn, :index))

    |> put_flash(:info, "Door group deleted successfully.")
    |> redirect(to: door_group_path(conn, :index))
  end
end


    case Repo.update(changeset) do
      {:ok, door_group} ->
        save_door_groups door_group, door_group_params
        conn
        |> put_flash(:info, "Door group updated successfully.")
        |> redirect(to: door_group_path(conn, :show, door_group))
