Sha256: 21d00ce2d05334641074ce0190ed95aad7543596b1014f0594f48fa627df9cb2
Contents?: true
Size: 478 Bytes
Versions: 9
Compression:
Stored size: 478 Bytes
Contents
require 'mks/common/methodresponse' require 'mks/common/util' module LookupList extend ActiveSupport::Concern def lookup clazz = get_model lookups = clazz.order(:name).select('id, name') response = Mks::Common::MethodResponse.new(true, nil, lookups, nil) render json: response end private def get_model get_model_name.constantize end def get_model_name name = self.class.to_s name.slice!('Controller') name.singularize end end
Version data entries
9 entries across 9 versions & 1 rubygems