From 6e5336f9bb2ae0bda604ea164352606112746c6f Mon Sep 17 00:00:00 2001 From: f Date: Tue, 19 Oct 2021 16:20:16 -0300 Subject: [PATCH] usar un controlador de api --- app/controllers/api_controller.rb | 10 ++++++++++ app/controllers/application_controller.rb | 7 ------- config/routes.rb | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 app/controllers/api_controller.rb diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb new file mode 100644 index 0000000..7d6e830 --- /dev/null +++ b/app/controllers/api_controller.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class ApiController < ActionController::API + # Por ahora hacer un echo de cada transacción + # + # @see {https://docutopia.tupale.co/sutty:nodemecu:api} + def transactions + render plain: params[:transaction_uuid], status: :ok + end +end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 616ff5a..75f7187 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -7,11 +7,4 @@ class ApplicationController < ActionController::Base end def index end - - # Por ahora hacer un echo de cada transacción - # - # @see {https://docutopia.tupale.co/sutty:nodemecu:api} - def transactions - render plain: params[:transaction_uuid], status: :ok - end end diff --git a/config/routes.rb b/config/routes.rb index 79813eb..2fa4570 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -6,5 +6,5 @@ Rails.application.routes.draw do end mount Blazer::Engine, at: 'blazer' - post :transactions, to: 'application#transactions' + post :transactions, to: 'api#transactions' end