From 7633dcb0ccd27436ff0bd30380628008b74ea5aa Mon Sep 17 00:00:00 2001 From: "Gregory N. Schmit" Date: Thu, 19 Dec 2024 18:25:34 -0600 Subject: [PATCH] Switch some controllers to use render_api. --- lib/rest_framework/mixins/base_controller_mixin.rb | 2 +- test/app/controllers/api/demo/root_controller.rb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/rest_framework/mixins/base_controller_mixin.rb b/lib/rest_framework/mixins/base_controller_mixin.rb index 85116b4..b00f634 100644 --- a/lib/rest_framework/mixins/base_controller_mixin.rb +++ b/lib/rest_framework/mixins/base_controller_mixin.rb @@ -35,7 +35,7 @@ module RESTFramework::Mixins::BaseControllerMixin # Default action for API root. def root - api_response({message: "This is the API root."}) + render_api({message: "This is the API root."}) end module ClassMethods diff --git a/test/app/controllers/api/demo/root_controller.rb b/test/app/controllers/api/demo/root_controller.rb index 5f1eaa2..e498667 100644 --- a/test/app/controllers/api/demo/root_controller.rb +++ b/test/app/controllers/api/demo/root_controller.rb @@ -2,18 +2,18 @@ class Api::Demo::RootController < Api::DemoController self.extra_actions = {nil: :get, blank: :get, echo: :post} def root - api_response({message: Api::DemoController::DESCRIPTION}) + render_api({message: Api::DemoController::DESCRIPTION}) end def nil - api_response(nil) + render_api(nil) end def blank - api_response("") + render_api("") end def echo - api_response({message: "Here is your data:", data: request.request_parameters}) + render_api({message: "Here is your data:", data: request.request_parameters}) end end