# File lib/merb-helpers/form/builder.rb, line 301 301: def label(contents, attrs = {}) 302: if contents 303: if contents.is_a?(Hash) 304: label_attrs = contents 305: contents = label_attrs.delete(:title) 306: else 307: label_attrs = attrs 308: end 309: tag(:label, contents, label_attrs) 310: else 311: "" 312: end 313: end
# File lib/merb-helpers/form/builder.rb, line 367 367: def submit(value, attrs = {}) 368: unbound_label(attrs) + super 369: end
# File lib/merb-helpers/form/builder.rb, line 340 340: def unbound_check_box(attrs = {}) 341: label_text = unbound_label(attrs) 342: super + label_text 343: end
# File lib/merb-helpers/form/builder.rb, line 323 323: def unbound_label(attrs = {}) 324: if attrs[:id] 325: label_attrs = {:for => attrs[:id]} 326: elsif attrs[:name] 327: label_attrs = {:for => attrs[:name]} 328: else 329: label_attrs = {} 330: end 331: 332: label_option = attrs.delete(:label) 333: if label_option.is_a? Hash 334: label(label_attrs.merge(label_option)) 335: else 336: label(label_option, label_attrs) 337: end 338: end
# File lib/merb-helpers/form/builder.rb, line 393 393: def radio_group_item(method, attrs) 394: unless attrs[:id] 395: attrs.merge!(:id => "#{@name}_#{method}_#{attrs[:value]}") 396: end 397: 398: attrs.merge!(:label => attrs[:label] || attrs[:value]) 399: super 400: end
# File lib/merb-helpers/form/builder.rb, line 373 373: def update_bound_controls(method, attrs, type) 374: attrs.merge!(:id => "#{@name}_#{method}") unless attrs[:id] 375: super 376: end
# File lib/merb-helpers/form/builder.rb, line 378 378: def update_unbound_controls(attrs, type) 379: if attrs[:name] && !attrs[:id] 380: attrs.merge!(:id => valid_xhtml_id(attrs[:name])) 381: end 382: case type 383: when "text", "radio", "password", "hidden", "checkbox", "file" 384: add_css_class(attrs, type) 385: end 386: super 387: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.