Class: Clot::SelectTag

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

Constant Summary

Constants inherited from ClotTag

ClotTag::Syntax

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



178
179
180
181
182
183
184
185
# File 'lib/clot/no_model_form_tags.rb', line 178

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



187
188
189
# File 'lib/clot/no_model_form_tags.rb', line 187

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