Class: Nitro::HasManyControl
- Inherits:
-
RelationControl
- Object
- Element
- Control
- AttributeControl
- RelationControl
- Nitro::HasManyControl
- Defined in:
- lib/nitro/control/relation/has_many.rb
Overview
HasMany, ManyToMany and JoinsMany
Instance Attribute Summary
Attributes inherited from AttributeControl
Attributes included from ElementMixin
#_children, #_parent, #_text, #_view, #id
Instance Method Summary collapse
-
#render ⇒ Object
pre :do_this, :on => :populate_object.
Methods inherited from RelationControl
Methods inherited from AttributeControl
Methods included from XhtmlHelper
#date_select, #datetime_select, #hidden, #href_of, #js_popup, #link_to, #objects_to_options, #onclick_popup, #options, #popup, #submit, #time_select
Methods inherited from Element
Methods included from ElementMixin
#add_child, #close, #content, #initialize, #open, #render_children
Constructor Details
This class inherits a constructor from Nitro::RelationControl
Instance Method Details
#render ⇒ Object
pre :do_this, :on => :populate_object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/nitro/control/relation/has_many.rb', line 11 def render str = "#{emit_label}" str << emit_container_start str << emit_js if selected_items.empty? str << emit_selector(:removable => false) else removable = selected_items.size != 1 ? true : false selected_items.each do |item| str << emit_selector(:selected => item.pk) end end str << emit_container_end end |