response.headers['Error'] = message
render :text => message, :status => status
end
+
+ def set_locale
+ I18n.locale = request.compatible_language_from(I18n.available_locales)
+ end
def api_call_handle_error
begin
end
private
-
# extract authorisation credentials from headers, returns user = nil if none
def get_auth_data
if request.env.has_key? 'X-HTTP_AUTHORIZATION' # where mod_rewrite might have put it