Class: Clot::InputTag

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



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

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



90
91
92
93
94
95
96
# File 'lib/clot/no_model_form_tags.rb', line 90

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