Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 884 generate api docs #2012

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true
class ApplicationController < ActionController::Base
class ApplicationController < ActionController::API
include ActionView::Helpers::UrlHelper
include ActionView::Helpers::DateHelper
include ActionView::Helpers::TextHelper
Expand Down
2 changes: 2 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

module Ifme
class Application < Rails::Application
# Configuration needed for changing an existing Rails app to API server
config.api_only = true
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 6.0

Expand Down
6 changes: 6 additions & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,10 @@

config.action_controller.default_url_options = { host: primary_domain }
config.action_controller.asset_host = primary_domain

# To render an HTML page with debugging information, use the value :default.
# To render debugging information preserving the response format, use the value :api.
# By default, config.debug_exception_response_format is set to :api, when config.api_only is set to true.
# But we set it here explicitly so that we can change it if we want and we know that it is on.
config.debug_exception_response_format = :api
end