Skip to content

Instantly share code, notes, and snippets.

@zacksiri
Created March 13, 2012 09:26
Show Gist options
  • Save zacksiri/2027806 to your computer and use it in GitHub Desktop.
Save zacksiri/2027806 to your computer and use it in GitHub Desktop.
ApiController Example
class ApiController < ActionController::Metal
include ActionController::Helpers
include ActionController::Redirecting
include ActionController::Rendering
include ActionController::Renderers::All
include ActionController::ConditionalGet
include ActionController::MimeResponds
include ActionController::RequestForgeryProtection
include ActionController::ForceSSL
include AbstractController::Callbacks
include ActionController::Instrumentation
include ActionController::ParamsWrapper
include Devise::Controllers::Helpers
include Rails.application.routes.url_helpers
append_view_path "#{Rails.root}/app/views"
wrap_parameters format: [:json]
protect_from_forgery
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment