Class: Answers::UiObjectsRelatableCategoryDropDownView

Inherits:
UiObjectView show all
Defined in:
lib/question_chain/models/answers/ui_objects_relatable_category_drop_down_view.rb

Instance Method Summary collapse

Methods inherited from UiObjectView

#css_classes, #default_styles, #default_value, #disabled, #dom_id, #extra_info, #has_extra_info, #input_id, #label, #name, #ui_object_name, #value

Methods inherited from MustacheRails

#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

#optionsObject

 @return [Array<Hash<value => value, name => name>>]



9
10
11
12
13
14
15
# File 'lib/question_chain/models/answers/ui_objects_relatable_category_drop_down_view.rb', line 9

def options
  if answer_params
    ui_object.options.map{|option| option.merge!(:selected => option["value"].to_s == value.to_s)}
  else
    ui_object.options
  end
end

#promptObject



4
5
6
# File 'lib/question_chain/models/answers/ui_objects_relatable_category_drop_down_view.rb', line 4

def prompt
  ui_object.prompt
end