heartcombo--simple_form/lib/simple_form/form_builder.rb

21 lines
439 B
Ruby
Raw Normal View History

require 'simple_form/label'
require 'simple_form/input'
2009-11-18 23:50:43 +00:00
module SimpleForm
class FormBuilder < ActionView::Helpers::FormBuilder
include SimpleForm::Label
include SimpleForm::Input
2009-11-19 21:26:16 +00:00
def input(attribute, options={})
2009-12-08 14:55:04 +00:00
@attribute, @options = attribute, options
@options.assert_valid_keys(:as, :label, :options, :html)
2009-12-08 13:48:31 +00:00
2009-12-08 14:55:04 +00:00
label = generate_label
input = generate_input
2009-12-08 13:48:31 +00:00
2009-12-08 14:55:04 +00:00
label << input
2009-11-19 21:26:16 +00:00
end
2009-11-18 23:50:43 +00:00
end
end