Sha256: 7dbcb63617331d58eeecedbacb227095b91273622def2edb3992b2acd2a509f8
Contents?: true
Size: 484 Bytes
Versions: 6
Compression:
Stored size: 484 Bytes
Contents
class GeoZone < ActiveRecord::Base acts_as_tree def to_jstree(element_to_count) hash = {} hash[:attributes] = { :id => "#{self.class.to_s.underscore}_#{id}", :type => 'folder' } hash[:data] = { :title => "#{name}<span>#{self.send(element_to_count).count}</span>", :attributes => { :class => 'big-icons', :style => 'category_picture' }} unless children.empty? hash[:children] = children.collect{ |g| g.to_jstree(element_to_count)} end hash end end
Version data entries
6 entries across 6 versions & 1 rubygems