Skip to content

Instantly share code, notes, and snippets.

@bartimaeus
Created May 27, 2014 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bartimaeus/6ae4a400b3d9dd9f86d1 to your computer and use it in GitHub Desktop.
Save bartimaeus/6ae4a400b3d9dd9f86d1 to your computer and use it in GitHub Desktop.
Basic API Setup
class Api::ApplicationController < ActionController::Metal
include ActionView::Layouts
include ActionController::Helpers
include ActionController::Rescue
include ActionController::Redirecting
include AbstractController::Rendering
include ActionController::Renderers::All
include ActionController::ImplicitRender
include ActionController::MimeResponds
include ActionController::ConditionalGet
include AbstractController::Callbacks
include ActionController::StrongParameters
include ActionController::Caching
include Rails.application.routes.url_helpers
respond_to :json
rescue_from NoMethodError, with: :no_method
rescue_from StandardError, with: :standard_error
rescue_from ActiveRecord::RecordNotFound, with: :record_not_found
rescue_from ActionView::MissingTemplate, with: :missing_template
append_view_path "#{Rails.root}/app/views"
# ...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment