diff --git a/app/controllers/entregas_controller.rb b/app/controllers/entregas_controller.rb new file mode 100644 index 0000000..6b367a7 --- /dev/null +++ b/app/controllers/entregas_controller.rb @@ -0,0 +1,6 @@ +class EntregasController < ApplicationController + def add + @entrega = Entrega.find_by(viaje: params[:viaje], nombre_recibe: params[:recibe]) + @entrega.update + end +end diff --git a/config/routes.rb b/config/routes.rb index 65daa13..d9ee8f9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,5 @@ Rails.application.routes.draw do + post "/entregas", to: "entregas#add" get "/ruta", to: 'ruta#get' post "/ruta", to: 'ruta#add' # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html diff --git a/test/test_helper.rb b/test/test_helper.rb index 7d4b674..bf7cfbb 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -17,5 +17,8 @@ module ActiveSupport def ruta_add_url "/ruta" end + def entregas_add_url + "/entrega" + end end end