Class: Clot::Label

Inherits:
LabelTag show all
Includes:
ModelTag
Defined in:
lib/clot/model_form_tags.rb

Instance Method Summary collapse

Methods included from ModelTag

#render

Methods inherited from LabelTag

#personal_attributes, #render_string

Methods inherited from ClotTag

#initialize, #render

Methods included from TagHelper

#resolve_value, #split_params

Methods included from AttributeSetter

#personal_attributes, #set_attributes

Constructor Details

This class inherits a constructor from Clot::ClotTag

Instance Method Details

#get_label_for(label) ⇒ Object



87
88
89
# File 'lib/clot/model_form_tags.rb', line 87

def get_label_for(label)
  label.humanize
end

#set_primary_attributes(context) ⇒ Object



91
92
93
94
95
96
97
98
# File 'lib/clot/model_form_tags.rb', line 91

def set_primary_attributes(context)
  super context
  if @params[0] && ! @params[0].match(/:/)
    @value_string = resolve_value(@params.shift,context)
  else
    @value_string = get_label_for(@attribute_name)
  end
end