Sha256: 797d00a6e45c621f347f0cac3bfa6dfeba23dc3e590cd38743eb7bfc14c40f40
Contents?: true
Size: 436 Bytes
Versions: 12
Compression:
Stored size: 436 Bytes
Contents
module Carnival::ModelHelper def to_s self.name end def self.included mod mod.extend ClassMethods end module ClassMethods def list_for_select(params = {}) select = [] select << ['', ''] if params[:add_empty_option] if params[:reverse] select.concat all.collect{|c|[c.to_s, c.id]} else select.concat all.collect{|c|[c.id, c.to_s]} end select end end end
Version data entries
12 entries across 12 versions & 1 rubygems