Sha256: 8ccd86b6c46e4cf03a7fb0c051c4b329c2b081c6bca625f26ca17411ebf25bab
Contents?: true
Size: 762 Bytes
Versions: 59
Compression:
Stored size: 762 Bytes
Contents
module Auth::Concerns::ActivityControllerConcern extend ActiveSupport::Concern included do respond_to :html,:json,:js end ##@used_in: jquery.calendario.js ##@param[Hash] : params should have range key(which is itself a hash, and a user_id key which is a string.), {range: {"from" => date[format: ], "to" => date[format: ]}, user_id: String} ##@return[Hash]: timestamp => activity_object hashified. def get_activities filt_test = permitted_params activities_hash = model.get_in_range(filt_test) respond_with activities_hash end ##gives the model class from the underlying controller def model Object.const_get(controller_name.classify) end def permitted_params params.permit(:user_id, range: [:from, :to], only: []) end end
Version data entries
59 entries across 59 versions & 1 rubygems