Class: Clot::SelectTag

Inherits:
ClotTag
  • Object
show all
Defined in:
lib/clot/no_model_form_tags.rb

Instance Method Summary collapse

Methods inherited from ClotTag

#initialize, #render

Methods included from TagHelper

#resolve_value, #split_params

Methods included from AttributeSetter

#set_attributes, #set_primary_attributes

Constructor Details

This class inherits a constructor from Clot::ClotTag

Instance Method Details

#personal_attributes(name, value) ⇒ Object



171
172
173
174
175
176
177
178
# File 'lib/clot/no_model_form_tags.rb', line 171

def personal_attributes(name,value)
  case name
    when 'multiple' then
      @multiple_string = %{multiple="#{value == "true" ? "multiple" : ""}" }
    when 'prompt' then
      @prompt_option = %{<option value="">#{value}</option>}
  end
end

#render_stringObject



180
181
182
# File 'lib/clot/no_model_form_tags.rb', line 180

def render_string
  %{<select #{@disabled_string}#{@class_string}id="#{@id_string}" #{@multiple_string}name="#{@name_string}#{unless @multiple_string.nil? then '[]' end}">#{@prompt_option}#{@value_string}</select>}
end