Method: Caprese::Query#query_params
- Defined in:
- lib/caprese/controller/concerns/query.rb
#query_params ⇒ Hash
The params that affect the query and subsequent response
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/caprese/controller/concerns/query.rb', line 62 def query_params if @query_params.blank? @query_params = params.except(:action, :controller) # Sort query by column, ascending or descending @query_params[:sort] = @query_params[:sort].split(',') if @query_params[:sort] # Convert fields params into arrays for each resource @query_params[:fields].each do |resource, fields| @query_params[:fields][resource] = fields.split(',') end if @query_params[:fields] end @query_params end |