Class: Skyline::Editors::CheckableList
- Inherits:
-
Editor
- Object
- Editor
- Skyline::Editors::CheckableList
- Defined in:
- app/helpers/skyline/editors/checkable_list.rb
Instance Attribute Summary collapse
-
#target_class ⇒ Object
readonly
Returns the value of attribute target_class.
Instance Method Summary collapse
-
#initialize(names, record, field, template) ⇒ CheckableList
constructor
A new instance of CheckableList.
- #output_without_errors ⇒ Object
Constructor Details
#initialize(names, record, field, template) ⇒ CheckableList
Returns a new instance of CheckableList.
4 5 6 7 8 9 10 11 12 13 |
# File 'app/helpers/skyline/editors/checkable_list.rb', line 4 def initialize(names,record,field,template) super reflection = self.field.reflection if reflection.macro == :has_and_belongs_to_many @target_class = reflection.klass else raise "CheckableList can only be used with HABTM associations (was: #{@reflection.macro})" end end |
Instance Attribute Details
#target_class ⇒ Object (readonly)
Returns the value of attribute target_class.
2 3 4 |
# File 'app/helpers/skyline/editors/checkable_list.rb', line 2 def target_class @target_class end |
Instance Method Details
#output_without_errors ⇒ Object
15 16 17 18 19 |
# File 'app/helpers/skyline/editors/checkable_list.rb', line 15 def output_without_errors content_tag("div", content_tag("ul",self.render_records), :class => "checkable-list") end |