Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

#method vs +method+ in Action View

  • Loading branch information...
commit 67603693b5933d825fb17036394fe913e6edde8e 1 parent 5ff769a
@fxn fxn authored
View
34 actionpack/lib/action_view/helpers/form_options_helper.rb
@@ -144,10 +144,10 @@ def country_select(object, method, priority_countries = nil, options = {}, html_
# In addition to the <tt>:include_blank</tt> option documented above,
# this method also supports a <tt>:model</tt> option, which defaults
# to TimeZone. This may be used by users to specify a different time
- # zone model object. (See #time_zone_options_for_select for more
+ # zone model object. (See +time_zone_options_for_select+ for more
# information.)
# Finally, this method supports a <tt>:default</tt> option, which selects
- # a default TimeZone if the object's time zone is nil.
+ # a default TimeZone if the object's time zone is +nil+.
#
# Examples:
# time_zone_select( "user", "time_zone", nil, :include_blank => true)
@@ -209,24 +209,22 @@ def options_from_collection_for_select(collection, value_method, text_method, se
options_for_select(options, selected)
end
- # Returns a string of <tt><option></tt> tags, like <tt>#options_from_collection_for_select</tt>, but
+ # Returns a string of <tt><option></tt> tags, like <tt>options_from_collection_for_select</tt>, but
# groups them by <tt><optgroup></tt> tags based on the object relationships of the arguments.
#
# Parameters:
- # +collection+:: An array of objects representing the <tt><optgroup></tt> tags
- # +group_method+:: The name of a method which, when called on a member of +collection+, returns an
- # array of child objects representing the <tt><option></tt> tags
- # +group_label_method+:: The name of a method which, when called on a member of +collection+, returns a
- # string to be used as the +label+ attribute for its <tt><optgroup></tt> tag
- # +option_key_method+:: The name of a method which, when called on a child object of a member of
- # +collection+, returns a value to be used as the +value+ attribute for its
- # <tt><option></tt> tag
- # +option_value_method+:: The name of a method which, when called on a child object of a member of
- # +collection+, returns a value to be used as the contents of its
- # <tt><option></tt> tag
- # +selected_key+:: A value equal to the +value+ attribute for one of the <tt><option></tt> tags,
- # which will have the +selected+ attribute set. Corresponds to the return value
- # of one of the calls to +option_key_method+. If +nil+, no selection is made.
+ # * +collection+ - An array of objects representing the <tt><optgroup></tt> tags.
+ # * +group_method+ - The name of a method which, when called on a member of +collection+, returns an
+ # array of child objects representing the <tt><option></tt> tags.
+ # * group_label_method+ - The name of a method which, when called on a member of +collection+, returns a
+ # string to be used as the +label+ attribute for its <tt><optgroup></tt> tag.
+ # * +option_key_method+ - The name of a method which, when called on a child object of a member of
+ # +collection+, returns a value to be used as the +value+ attribute for its <tt><option></tt> tag.
+ # * +option_value_method+ - The name of a method which, when called on a child object of a member of
+ # +collection+, returns a value to be used as the contents of its <tt><option></tt> tag.
+ # * +selected_key+ - A value equal to the +value+ attribute for one of the <tt><option></tt> tags,
+ # which will have the +selected+ attribute set. Corresponds to the return value of one of the calls
+ # to +option_key_method+. If +nil+, no selection is made.
#
# Example object structure for use with this method:
# class Continent < ActiveRecord::Base
@@ -293,7 +291,7 @@ def country_options_for_select(selected = nil, priority_countries = nil)
#
# By default, +model+ is the TimeZone constant (which can be obtained
# in ActiveRecord as a value object). The only requirement is that the
- # +model+ parameter be an object that responds to #all, and returns
+ # +model+ parameter be an object that responds to +all+, and returns
# an array of objects that represent time zones.
#
# NOTE: Only the option tags are returned, you have to wrap this call in
View
8 actionpack/lib/action_view/helpers/prototype_helper.rb
@@ -595,8 +595,8 @@ def include_helpers_from_context
# JavaScript sent with a Content-type of "text/javascript".
#
# Create new instances with PrototypeHelper#update_page or with
- # ActionController::Base#render, then call #insert_html, #replace_html,
- # #remove, #show, #hide, #visual_effect, or any other of the built-in
+ # ActionController::Base#render, then call +insert_html+, +replace_html+,
+ # +remove+, +show+, +hide+, +visual_effect+, or any other of the built-in
# methods on the yielded generator in any order you like to modify the
# content and appearance of the current page.
#
@@ -687,7 +687,7 @@ def [](id)
end
end
- # Returns an object whose <tt>#to_json</tt> evaluates to +code+. Use this to pass a literal JavaScript
+ # Returns an object whose <tt>to_json</tt> evaluates to +code+. Use this to pass a literal JavaScript
# expression as an argument to another JavaScriptGenerator method.
def literal(code)
ActiveSupport::JSON::Variable.new(code.to_s)
@@ -1173,7 +1173,7 @@ def initialize(generator, variable)
super(generator)
end
- # The JSON Encoder calls this to check for the #to_json method
+ # The JSON Encoder calls this to check for the +to_json+ method
# Since it's a blank slate object, I suppose it responds to anything.
def respond_to?(method)
true
View
31 actionpack/lib/action_view/helpers/sanitize_helper.rb
@@ -57,7 +57,7 @@ def sanitize(html, options = {})
self.class.white_list_sanitizer.sanitize(html, options)
end
- # Sanitizes a block of css code. Used by #sanitize when it comes across a style attribute
+ # Sanitizes a block of CSS code. Used by +sanitize+ when it comes across a style attribute.
def sanitize_css(style)
self.class.white_list_sanitizer.sanitize_css(style)
end
@@ -111,8 +111,8 @@ class << base
end
end
- # Gets the HTML::FullSanitizer instance used by strip_tags. Replace with
- # any object that responds to #sanitize
+ # Gets the HTML::FullSanitizer instance used by +strip_tags+. Replace with
+ # any object that responds to +sanitize+.
#
# Rails::Initializer.run do |config|
# config.action_view.full_sanitizer = MySpecialSanitizer.new
@@ -122,8 +122,8 @@ def full_sanitizer
@full_sanitizer ||= HTML::FullSanitizer.new
end
- # Gets the HTML::LinkSanitizer instance used by strip_links. Replace with
- # any object that responds to #sanitize
+ # Gets the HTML::LinkSanitizer instance used by +strip_links+. Replace with
+ # any object that responds to +sanitize+.
#
# Rails::Initializer.run do |config|
# config.action_view.link_sanitizer = MySpecialSanitizer.new
@@ -133,8 +133,8 @@ def link_sanitizer
@link_sanitizer ||= HTML::LinkSanitizer.new
end
- # Gets the HTML::WhiteListSanitizer instance used by sanitize and sanitize_css.
- # Replace with any object that responds to #sanitize
+ # Gets the HTML::WhiteListSanitizer instance used by sanitize and +sanitize_css+.
+ # Replace with any object that responds to +sanitize+.
#
# Rails::Initializer.run do |config|
# config.action_view.white_list_sanitizer = MySpecialSanitizer.new
@@ -144,7 +144,7 @@ def white_list_sanitizer
@white_list_sanitizer ||= HTML::WhiteListSanitizer.new
end
- # Adds valid HTML attributes that the #sanitize helper checks for URIs.
+ # Adds valid HTML attributes that the +sanitize+ helper checks for URIs.
#
# Rails::Initializer.run do |config|
# config.action_view.sanitized_uri_attributes = 'lowsrc', 'target'
@@ -154,7 +154,7 @@ def sanitized_uri_attributes=(attributes)
HTML::WhiteListSanitizer.uri_attributes.merge(attributes)
end
- # Adds to the Set of 'bad' tags for the #sanitize helper.
+ # Adds to the Set of 'bad' tags for the +sanitize+ helper.
#
# Rails::Initializer.run do |config|
# config.action_view.sanitized_bad_tags = 'embed', 'object'
@@ -163,7 +163,8 @@ def sanitized_uri_attributes=(attributes)
def sanitized_bad_tags=(attributes)
HTML::WhiteListSanitizer.bad_tags.merge(attributes)
end
- # Adds to the Set of allowed tags for the #sanitize helper.
+
+ # Adds to the Set of allowed tags for the +sanitize+ helper.
#
# Rails::Initializer.run do |config|
# config.action_view.sanitized_allowed_tags = 'table', 'tr', 'td'
@@ -173,7 +174,7 @@ def sanitized_allowed_tags=(attributes)
HTML::WhiteListSanitizer.allowed_tags.merge(attributes)
end
- # Adds to the Set of allowed html attributes for the #sanitize helper.
+ # Adds to the Set of allowed HTML attributes for the +sanitize+ helper.
#
# Rails::Initializer.run do |config|
# config.action_view.sanitized_allowed_attributes = 'onclick', 'longdesc'
@@ -183,7 +184,7 @@ def sanitized_allowed_attributes=(attributes)
HTML::WhiteListSanitizer.allowed_attributes.merge(attributes)
end
- # Adds to the Set of allowed css properties for the #sanitize and #sanitize_css heleprs.
+ # Adds to the Set of allowed CSS properties for the #sanitize and +sanitize_css+ heleprs.
#
# Rails::Initializer.run do |config|
# config.action_view.sanitized_allowed_css_properties = 'expression'
@@ -193,7 +194,7 @@ def sanitized_allowed_css_properties=(attributes)
HTML::WhiteListSanitizer.allowed_css_properties.merge(attributes)
end
- # Adds to the Set of allowed css keywords for the #sanitize and #sanitize_css helpers.
+ # Adds to the Set of allowed css keywords for the +sanitize+ and +sanitize_css+ helpers.
#
# Rails::Initializer.run do |config|
# config.action_view.sanitized_allowed_css_keywords = 'expression'
@@ -203,7 +204,7 @@ def sanitized_allowed_css_keywords=(attributes)
HTML::WhiteListSanitizer.allowed_css_keywords.merge(attributes)
end
- # Adds to the Set of allowed shorthand css properties for the #sanitize and #sanitize_css helpers.
+ # Adds to the Set of allowed shorthand CSS properties for the +sanitize+ and +sanitize_css+ helpers.
#
# Rails::Initializer.run do |config|
# config.action_view.sanitized_shorthand_css_properties = 'expression'
@@ -213,7 +214,7 @@ def sanitized_shorthand_css_properties=(attributes)
HTML::WhiteListSanitizer.shorthand_css_properties.merge(attributes)
end
- # Adds to the Set of allowed protocols for the #sanitize helper.
+ # Adds to the Set of allowed protocols for the +sanitize+ helper.
#
# Rails::Initializer.run do |config|
# config.action_view.sanitized_allowed_protocols = 'ssh', 'feed'
View
4 actionpack/lib/action_view/template.rb
@@ -93,9 +93,9 @@ def raise_missing_template_exception
# Register a class that knows how to handle template files with the given
# extension. This can be used to implement new template types.
# The constructor for the class must take the ActiveView::Base instance
- # as a parameter, and the class must implement a #render method that
+ # as a parameter, and the class must implement a +render+ method that
# takes the contents of the template to render as well as the Hash of
- # local assigns available to the template. The #render method ought to
+ # local assigns available to the template. The +render+ method ought to
# return the rendered template as a string.
def self.register_template_handler(extension, klass)
@@template_handlers[extension.to_sym] = klass
Please sign in to comment.
Something went wrong with that request. Please try again.