Class: UiGroup

Inherits:
Object
  • Object
show all
Includes:
MongoMapper::Document, MongoMapper::Serialize
Defined in:
lib/question_chain/models/ui_group.rb

Overview

holds a group of ui objects basically  keep simple to start of with

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.attributes_for_apiObject



48
49
50
# File 'lib/question_chain/models/ui_group.rb', line 48

def self.attributes_for_api
  %w(id name label question_id relatable_category_filter ui_objects ui_attributes default_styles css_classes)
end

Instance Method Details

#css_classesObject



63
64
65
# File 'lib/question_chain/models/ui_group.rb', line 63

def css_classes
  read_attribute(:css_classes).join(" ")
end

#default_stylesObject

this should go into the mustache view basically



53
54
55
56
57
58
59
60
61
# File 'lib/question_chain/models/ui_group.rb', line 53

def default_styles
  default_styles = ""
  self.ui_attributes.each_pair do |key, value|
    if key.to_s == "visible" && value == false
      default_styles << "display:none;visibility:hidden;"
    end
  end
  default_styles
end