aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2004-12-16 17:45:37 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2004-12-16 17:45:37 +0000
commit0b554201bb2deb6bbb23de9b00aebd53b134921b (patch)
tree5fd8b334d49b7df5c4ae9d83ea7dd118d44678a1 /actionpack/lib/action_view/helpers
parentf389a8fb5d15d2433cea93b2833dce751dec8edc (diff)
downloadrails-0b554201bb2deb6bbb23de9b00aebd53b134921b.tar.gz
rails-0b554201bb2deb6bbb23de9b00aebd53b134921b.tar.bz2
rails-0b554201bb2deb6bbb23de9b00aebd53b134921b.zip
Updated documentation
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@194 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r--actionpack/lib/action_view/helpers/active_record_helper.rb6
-rw-r--r--actionpack/lib/action_view/helpers/form_helper.rb6
-rw-r--r--actionpack/lib/action_view/helpers/tag_helper.rb10
-rw-r--r--actionpack/lib/action_view/helpers/url_helper.rb8
4 files changed, 16 insertions, 14 deletions
diff --git a/actionpack/lib/action_view/helpers/active_record_helper.rb b/actionpack/lib/action_view/helpers/active_record_helper.rb
index a2b5a8b004..07ede179e6 100644
--- a/actionpack/lib/action_view/helpers/active_record_helper.rb
+++ b/actionpack/lib/action_view/helpers/active_record_helper.rb
@@ -83,9 +83,9 @@ module ActionView
# Returns a string with a div containing all the error messages for the object located as an instance variable by the name
# of <tt>object_name</tt>. This div can be tailored by the following options:
#
- # ::header_tag: Used for the header of the error div (default: h2)
- # ::id: The id of the error div (default: errorExplanation)
- # ::class: The class of the error div (default: errorExplanation)
+ # * <tt>header_tag</tt> - Used for the header of the error div (default: h2)
+ # * <tt>id</tt> - The id of the error div (default: errorExplanation)
+ # * <tt>class</tt> - The class of the error div (default: errorExplanation)
def error_messages_for(object_name, options={})
object = instance_eval "@#{object_name}"
unless object.errors.empty?
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb
index 0a406cfc47..253b389a79 100644
--- a/actionpack/lib/action_view/helpers/form_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_helper.rb
@@ -91,11 +91,13 @@ module ActionView
#
# Example (call, result). Imagine that @post.validated? returns 1:
# check_box("post", "validated")
- # <input type="checkbox" id="post_validate" name="post[validated] value="1" checked="checked" /><input name="post[validated]" type="hidden" value="0" />
+ # <input type="checkbox" id="post_validate" name="post[validated] value="1" checked="checked" />
+ # <input name="post[validated]" type="hidden" value="0" />
#
# Example (call, result). Imagine that @puppy.gooddog returns no:
# check_box("puppy", "gooddog", {}, "yes", "no")
- # <input type="checkbox" id="puppy_gooddog" name="puppy[gooddog] value="yes" /><input name="puppy[gooddog]" type="hidden" value="no" />
+ # <input type="checkbox" id="puppy_gooddog" name="puppy[gooddog] value="yes" />
+ # <input name="puppy[gooddog]" type="hidden" value="no" />
def check_box(object, method, options = {}, checked_value = "1", unchecked_value = "0")
InstanceTag.new(object, method, self).to_check_box_tag(options, checked_value, unchecked_value)
end
diff --git a/actionpack/lib/action_view/helpers/tag_helper.rb b/actionpack/lib/action_view/helpers/tag_helper.rb
index 6139943567..bf81d5d909 100644
--- a/actionpack/lib/action_view/helpers/tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/tag_helper.rb
@@ -7,16 +7,16 @@ module ActionView
include ERB::Util
# Examples:
- # * tag("br") => <br />
- # * tag("input", { "type" => "text"}) => <input type="text" />
+ # * <tt>tag("br") => <br /></tt>
+ # * <tt>tag("input", { "type" => "text"}) => <input type="text" /></tt>
def tag(name, options = {}, open = false)
"<#{name}#{tag_options(options)}" + (open ? ">" : " />")
end
# Examples:
- # * content_tag("p", "Hello world!") => <p>Hello world!</p>
- # * content_tag("div", content_tag("p", "Hello world!"), "class" => "strong") =>
- # <div class="strong"><p>Hello world!</p></div>
+ # * <tt>content_tag("p", "Hello world!") => <p>Hello world!</p></tt>
+ # * <tt>content_tag("div", content_tag("p", "Hello world!"), "class" => "strong") => </tt>
+ # <tt><div class="strong"><p>Hello world!</p></div></tt>
def content_tag(name, content, options = {})
"<#{name}#{tag_options(options)}>#{content}</#{name}>"
end
diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb
index f0eed442cf..127c7a42d5 100644
--- a/actionpack/lib/action_view/helpers/url_helper.rb
+++ b/actionpack/lib/action_view/helpers/url_helper.rb
@@ -30,10 +30,10 @@ module ActionView
# get a link tag that just points without consideration. The <tt>html_options</tt> works jointly for the image and ahref tag by
# letting the following special values enter the options on the image and the rest goes to the ahref:
#
- # ::alt: If no alt text is given, the file name part of the +src+ is used (capitalized and without the extension)
- # ::size: Supplied as "XxY", so "30x45" becomes width="30" and height="45"
- # ::border: Is set to 0 by default
- # ::align: Sets the alignment, no special features
+ # * <tt>alt</tt> - If no alt text is given, the file name part of the +src+ is used (capitalized and without the extension)
+ # * <tt>size</tt> - Supplied as "XxY", so "30x45" becomes width="30" and height="45"
+ # * <tt>border</tt> - Is set to 0 by default
+ # * <tt>align</tt> - Sets the alignment, no special features
#
# The +src+ can be supplied as a...
# * full path, like "/my_images/image.gif"