Skip to content

Instantly share code, notes, and snippets.

@TheNicholasNick
Created January 15, 2009 02:51
Show Gist options
  • Save TheNicholasNick/47241 to your computer and use it in GitHub Desktop.
Save TheNicholasNick/47241 to your computer and use it in GitHub Desktop.
module Merb::Helpers::Form::Builder
class Form < Base
def label(contents, attrs = {})
if contents
if contents.is_a?(Hash)
label_attrs = contents
contents = label_attrs.delete(:title)
else
label_attrs = attrs
end
tag(:label, contents, label_attrs)
else
""
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment