Skip to content

Commit

Permalink
Added password_field. Needs to be refactored with text_field.
Browse files Browse the repository at this point in the history
  • Loading branch information
topfunky committed Mar 3, 2009
1 parent e89e71a commit c73f634
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/good_form_builder.rb
Expand Up @@ -24,7 +24,17 @@ def text_field(field, *args)
:class => label_class,
:for => [@object_name, field].join('_'))
end

def password_field(field, *args)
options = args.last.is_a?(Hash) ? args.pop : {}

label_class = (options.delete(:class) || 'field')
@template.content_tag("label",
(options.delete(:label) || field.to_s.titleize) + super,
:class => label_class,
:for => [@object_name, field].join('_'))
end

def radio_button(field, tag_value, options={})
label_title = options.delete(:label)
options[:class] = "radiobutton"
Expand Down Expand Up @@ -52,6 +62,3 @@ def collection_select(field, collection, value_method, text_method, options={},
end

end



0 comments on commit c73f634

Please sign in to comment.