aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/form_helper.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-11-30 21:45:31 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-11-30 21:45:31 +0000
commit8dca6586ded76d5950b4fccfb720e2861efede6d (patch)
tree4a3e38a9ba2667245d6ea4bfd8e23fa5179b2848 /actionpack/lib/action_view/helpers/form_helper.rb
parentec75642e137a8682b099009ab205f764fe70c51e (diff)
downloadrails-8dca6586ded76d5950b4fccfb720e2861efede6d.tar.gz
rails-8dca6586ded76d5950b4fccfb720e2861efede6d.tar.bz2
rails-8dca6586ded76d5950b4fccfb720e2861efede6d.zip
Fixed that script/server running against Mongrel should tail the proper log regardless of the environment [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5652 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_view/helpers/form_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/form_helper.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb
index 8aa0b42fe1..8d89f74c3b 100644
--- a/actionpack/lib/action_view/helpers/form_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_helper.rb
@@ -223,6 +223,11 @@ module ActionView
def radio_button(object_name, method, tag_value, options = {})
InstanceTag.new(object_name, method, self, nil, options.delete(:object)).to_radio_button_tag(tag_value, options)
end
+
+
+ def label(object_name, method, options = {})
+ InstanceTag.new(object_name, method, self, nil, options.delete(:object)).to_label_tag(options)
+ end
end
class InstanceTag #:nodoc:
@@ -328,6 +333,10 @@ module ActionView
tag_text << ">True</option></select>"
end
+ def to_label_tag(options = {})
+ label_tag(options.delete(:text) || value(object).humanize, options.reverse_merge(:for => tag_id))
+ end
+
def to_content_tag(tag_name, options = {})
content_tag(tag_name, value(object), options)
end