Class: Clot::LabelTag

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

Direct Known Subclasses

Label

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



193
194
195
196
197
198
# File 'lib/clot/no_model_form_tags.rb', line 193

def personal_attributes(name,value)
  case name
    when 'value' then
      @id_string << "_#{value}"
  end
end

#render_stringObject



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

def render_string
  @value_string ||= @name_string.humanize
  %{<label #{@class_string}for="#{@id_string}">#{@value_string}</label>}
end