Class: Merb::Helpers::Form::Builder::Form
- Inherits:
-
Base
- Object
- Base
- Merb::Helpers::Form::Builder::Form
show all
- Defined in:
- lib/merb-helpers/form/builder.rb
Instance Method Summary
collapse
Methods inherited from Base
#bound_check_box, #bound_radio_button, #bound_radio_group, #bound_select, #bound_text_area, #fieldset, #form, #initialize, #unbound_radio_group
Methods included from Tag
#close_tag, #open_tag, #self_closing_tag, #tag
Instance Method Details
342
343
344
|
# File 'lib/merb-helpers/form/builder.rb', line 342
def button(contents, attrs = {})
label(attrs) + super
end
|
#label(contents, attrs = {}) ⇒ Object
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
|
# File 'lib/merb-helpers/form/builder.rb', line 293
def label(contents, attrs = {})
if contents.is_a?(Hash)
attrs = contents
contents = attrs.delete(:label)
end
if contents
for_attr = attrs[:id] ? {:for => attrs[:id]} : {}
if contents.is_a?(Hash)
attrs = contents
contents = attrs.delete(:title)
for_attr = for_attr.merge(attrs)
end
tag(:label, contents, for_attr)
else
""
end
end
|
#submit(value, attrs = {}) ⇒ Object
346
347
348
|
# File 'lib/merb-helpers/form/builder.rb', line 346
def submit(value, attrs = {})
label(attrs) + super
end
|
#unbound_check_box(attrs = {}) ⇒ Object
319
320
321
322
|
# File 'lib/merb-helpers/form/builder.rb', line 319
def unbound_check_box(attrs = {})
label_text = label(attrs)
super + label_text
end
|
#unbound_hidden_field(attrs = {}) ⇒ Object
324
325
326
327
|
# File 'lib/merb-helpers/form/builder.rb', line 324
def unbound_hidden_field(attrs = {})
attrs.delete(:label)
super
end
|
329
330
331
332
|
# File 'lib/merb-helpers/form/builder.rb', line 329
def unbound_radio_button(attrs = {})
label_text = label(attrs)
super + label_text
end
|
#unbound_select(attrs = {}) ⇒ Object
334
335
336
|
# File 'lib/merb-helpers/form/builder.rb', line 334
def unbound_select(attrs = {})
label(attrs) + super
end
|
#unbound_text_area(contents, attrs = {}) ⇒ Object
338
339
340
|
# File 'lib/merb-helpers/form/builder.rb', line 338
def unbound_text_area(contents, attrs = {})
label(attrs) + super
end
|