Base progress
This commit is contained in:
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user