Skip to content

Commit

Permalink
Switch some controllers to use render_api.
Browse files Browse the repository at this point in the history
  • Loading branch information
gregschmit committed Dec 20, 2024
1 parent c04f88f commit 7633dcb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/rest_framework/mixins/base_controller_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions test/app/controllers/api/demo/root_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 7633dcb

Please sign in to comment.