this worked only when params[:id].to_i did NOT equal an existing id. Now it's more robust.