module SerializePartialsAttributes::ControllerExtensions
Public Instance Methods
render(*args, &block)
click to toggle source
Calls superclass method
# File lib/serialize_partials_attributes/controller_extensions.rb, line 3 def render *args, &block args[0].merge!(attributes_to_serialize) super end
Private Instance Methods
attributes_to_serialize()
click to toggle source
# File lib/serialize_partials_attributes/controller_extensions.rb, line 8 def attributes_to_serialize {only_attributes: fields_params} end
fields_params()
click to toggle source
# File lib/serialize_partials_attributes/controller_extensions.rb, line 11 def fields_params if params.has_key?(SerializePartialsAttributes::Configuration.field) params[:fields].split(SerializePartialsAttributes::Configuration.split_by) end end