include CurrentApiClient
protect_from_forgery
- before_filter :uncamelcase_params_hash_keys
around_filter :thread_with_auth_info, :except => [:render_error, :render_not_found]
before_filter :remote_ip
return @attrs if @attrs
@attrs = params[resource_name]
if @attrs.is_a? String
- @attrs = uncamelcase_hash_keys(Oj.load @attrs)
+ @attrs = Oj.load @attrs
end
unless @attrs.is_a? Hash
message = "No #{resource_name}"
end
end
- def uncamelcase_params_hash_keys
- self.params = uncamelcase_hash_keys(params)
- end
- def uncamelcase_hash_keys(h, max_depth=-1)
- if h.is_a? Hash and max_depth != 0
- nh = Hash.new
- h.each do |k,v|
- if k.class == String
- nk = k.underscore
- elsif k.class == Symbol
- nk = k.to_s.underscore.to_sym
- else
- nk = k
- end
- nh[nk] = uncamelcase_hash_keys(v, max_depth-1)
- end
- h.replace(nh)
- end
- h
- end
-
def render_list
@object_list = {
:kind => "arvados##{resource_name}List",
class StaticController < ApplicationController
- skip_before_filter :uncamelcase_params_hash_keys
skip_before_filter :find_object_by_uuid
skip_before_filter :require_auth_scope_all, :only => :home
class UserSessionsController < ApplicationController
before_filter :require_auth_scope_all, :only => [ :destroy ]
- skip_before_filter :uncamelcase_params_hash_keys
skip_before_filter :find_object_by_uuid
respond_to :html