Class: Clot::InputTag

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



74
75
76
77
78
79
80
81
# File 'lib/clot/no_model_form_tags.rb', line 74

def personal_attributes(name,value)
  case name
    when "size" then
      @size_string = %{size="#{value}" }
    when "width" then
      @size_string = %{width="#{value}" }
  end
end

#render_stringObject



83
84
85
86
87
88
89
# File 'lib/clot/no_model_form_tags.rb', line 83

def render_string
  unless @value_string.nil?
    @value_string = CGI::escapeHTML(@value_string.to_s)
    @value_string = %{value="#{@value_string}" }
  end
  %{<input #{@accept_string}#{@disabled_string}#{@class_string}id="#{@id_string}" #{@max_length_string}name="#{@name_string}" #{@size_string}#{@onchange_string}type="#{@type}" #{@value_string}/>}
end