Class: Clot::CollectionSelect
- Defined in:
- lib/clot/model_form_tags.rb
Constant Summary
Constants inherited from ClotTag
Instance Method Summary collapse
-
#render(context) ⇒ Object
usage: collection_select “order” method:“country_id”, collection:available_countries, value_method:‘id’, text_method:‘name’, html_options:“{class:‘large-field’” %}.
Methods inherited from ClotTag
Methods included from TagHelper
Methods included from AttributeSetter
#personal_attributes, #set_attributes, #set_primary_attributes
Constructor Details
This class inherits a constructor from Clot::ClotTag
Instance Method Details
#render(context) ⇒ Object
usage: collection_select “order” method:“country_id”, collection:available_countries, value_method:‘id’, text_method:‘name’, html_options:“{class:‘large-field’” %}
98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/clot/model_form_tags.rb', line 98 def render(context) super(context) # collection_select(object, method, collection, value_method, text_method, options = {}, html_options = {}) method = @attributes['method'] collection = @attributes['collection'] value_method = @attributes['value_method'] text_method = @attributes['text_method'] @attributes.has_key?('options') ? = @attributes['options'] : = {} @attributes.has_key?('html_options') ? = @attributes['html_options'] : = {} context.registers[:action_view].collection_select(@form_object, method, collection, value_method, text_method, , ) end |