Skip to content

Instantly share code, notes, and snippets.

@danturu
Created July 17, 2012 06:26
Show Gist options
  • Save danturu/3127585 to your computer and use it in GitHub Desktop.
Save danturu/3127585 to your computer and use it in GitHub Desktop.
RSpec and anonymous controller 1
class Api::BaseController < ActionController::Base
respond_to :json
protected
def current_company
@current_company ||= Company.find_by_api_key! request.headers["Api-Key"]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment