module MasterView module Directives # creates a collection_select helper. quotes object and method if necessary, merges # html options specfied on element into any html options in attr_value # attr_value syntax: # object, method, collection, value_method, text_method, options = {}, html_options = {} # class CollectionSelect < MasterView::DirectiveBase metadata :priority => :default, :category => 'form', :description => 'Replaces the element with a Rails collection_select form helper.', :element_usage => 'select' attr_arg :object_name, :quote => true attr_arg :method, :quote => true attr_arg :collection , :quote => true attr_arg :value_method, :quote => true attr_arg :text_method, :quote => true attr_arg :options, :default => {} attr_arg :html_options, :append_element_attrs => [:common_html] event :element do render erb_content( 'collection_select', :object_name, :method, :collection, :value_method, :text_method, :options, :html_options) end end end end