Skip to content

Instantly share code, notes, and snippets.

View SokratisVidros's full-sized avatar

Sokratis Vidros SokratisVidros

View GitHub Profile
require 'json_responder'
class Api::V1::ApiController < ActionController::Base
respond_to :json
before_filter :authenticate_user
self.responder = JsonResponder
rescue_from ActiveRecord::RecordNotFound, with: :not_found
rescue_from ActiveModel::MassAssignmentSecurity::Error, with: :bad_request
rescue_from AccessForbidden, with: :access_forbidden
rescue_from InvalidTransition, with: :invalid_transition