Base progress

This commit is contained in:
2015-09-16 11:50:55 +02:00
parent ef894f9e02
commit 6a085b1ca2
52 changed files with 3686 additions and 1818 deletions
+14 -10
View File
@@ -58,16 +58,20 @@ private
I18n.locale = params[:locale].presence.try(:to_sym) || Rails.configuration.i18n.default_locale
end
#def _render_with_renderer_json(resource, options)
#serializer = build_json_serializer(resource, options)
#binding.pry
#if serializer
#super(serializer, options)
#else
#super
#end
#end
def _render_with_renderer_json(resource, options)
return super if resource.is_a?(Hash)
options[:serializer] ||= begin
if resource.is_a?(SimplyStored::Couch)
#infer based on controller path replacing actual controller part with resouce part /lists/:id/table
"#{self.class.name.deconstantize}::#{resource.class.name.demodulize}Serializer".constantize
else
# infer based on controller path
"#{controller_path.classify}Serializer".constantize
end
end
options[:is_collection] = params[:id].blank? unless options.has_key?(:is_collection)
JSONAPI::Serializer.serialize(resource, options).to_json
end
def layout_by_resource(*args)
#if devise_controller?