diff options
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/base.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_view/helpers/active_record_helper.rb | 6 | ||||
-rw-r--r-- | actionpack/lib/action_view/helpers/form_helper.rb | 6 | ||||
-rw-r--r-- | actionpack/lib/action_view/helpers/tag_helper.rb | 10 | ||||
-rw-r--r-- | actionpack/lib/action_view/helpers/url_helper.rb | 8 |
5 files changed, 17 insertions, 15 deletions
diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index 24c33cd11d..ad809e2bff 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -141,7 +141,7 @@ module ActionView #:nodoc: end end - def self.controller_delegate(*methods) + def self.controller_delegate(*methods)#:nodoc: methods.flatten.each do |method| class_eval <<-end_eval def #{method}(*args, &block) 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" |