Class: Answers::UiObjectView
Instance Method Summary
collapse
#initialize, #method_missing, #render, #respond_to?, #template=
Constructor Details
This class inherits a constructor from MustacheRails
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class MustacheRails
Instance Method Details
#css_classes ⇒ Object
16
17
18
|
# File 'lib/question_chain/models/answers/ui_object_view.rb', line 16
def css_classes
ui_object.css_classes.join(" ")
end
|
#default_styles ⇒ Object
44
45
46
47
48
49
50
51
52
|
# File 'lib/question_chain/models/answers/ui_object_view.rb', line 44
def default_styles
default_styles = ""
ui_object.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
|
#default_value ⇒ Object
40
41
42
|
# File 'lib/question_chain/models/answers/ui_object_view.rb', line 40
def default_value
ui_object.default_value
end
|
#disabled ⇒ Object
54
55
56
|
# File 'lib/question_chain/models/answers/ui_object_view.rb', line 54
def disabled
ui_object.ui_attributes["disable"] == "true"
end
|
#dom_id ⇒ Object
4
5
6
|
# File 'lib/question_chain/models/answers/ui_object_view.rb', line 4
def dom_id
"ui_object_#{ui_object.id}"
end
|
12
13
14
|
# File 'lib/question_chain/models/answers/ui_object_view.rb', line 12
def
ui_object.try(:extra_info)
end
|
20
21
22
|
# File 'lib/question_chain/models/answers/ui_object_view.rb', line 20
def
!.blank?
end
|
8
9
10
|
# File 'lib/question_chain/models/answers/ui_object_view.rb', line 8
def input_id
"ui_input_#{ui_object.id}"
end
|
#label ⇒ Object
24
25
26
|
# File 'lib/question_chain/models/answers/ui_object_view.rb', line 24
def label
ui_object.label
end
|
#name ⇒ Object
36
37
38
|
# File 'lib/question_chain/models/answers/ui_object_view.rb', line 36
def name
"answer[#{ui_object.name}]"
end
|
#ui_object_name ⇒ Object
32
33
34
|
# File 'lib/question_chain/models/answers/ui_object_view.rb', line 32
def ui_object_name
ui_object.name
end
|
#value ⇒ Object
28
29
30
|
# File 'lib/question_chain/models/answers/ui_object_view.rb', line 28
def value
answer_params[ui_object_name] if answer_params
end
|