Misc doc fixes (typos/grammar/etc). Closes #2445.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2537 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
6823f57b27
commit
7aa1ba7ff0
@ -1,5 +1,7 @@
|
||||
*SVN*
|
||||
|
||||
* Misc doc fixes (typos/grammar/etc). #2445. [coffee2code]
|
||||
|
||||
* Speed improvement for session_options. #2287. [skaes@web.de]
|
||||
|
||||
* Make cacheing binary files friendly with Windows. #1975. [Rich Olson]
|
||||
|
@ -38,7 +38,7 @@ class ActionViewError < StandardError #:nodoc:
|
||||
# result of the rendering. The output embedding writes it to the current template.
|
||||
#
|
||||
# But you don't have to restrict yourself to static includes. Templates can share variables amongst themselves by using instance
|
||||
# variables defined in using the regular embedding tags. Like this:
|
||||
# variables defined using the regular embedding tags. Like this:
|
||||
#
|
||||
# <% @page_title = "A Wonderful Hello" %>
|
||||
# <%= render "shared/header" %>
|
||||
@ -425,4 +425,4 @@ def compile_template(extension, template, file_name, local_assigns)
|
||||
end
|
||||
end
|
||||
|
||||
require 'action_view/template_error'
|
||||
require 'action_view/template_error'
|
||||
|
@ -49,9 +49,9 @@ def javascript_path(source)
|
||||
# <script type="text/javascript" src="/javascripts/scriptaculous.js"></script>
|
||||
# <script type="text/javascript" src="/javascripts/application.js"></script> *see beloe
|
||||
#
|
||||
# If there's a <tt>application.js</tt> file in your <tt>public/javascripts</tt> directory,
|
||||
# If there's an <tt>application.js</tt> file in your <tt>public/javascripts</tt> directory,
|
||||
# <tt>javascript_include_tag :defaults</tt> will automatically include it. This file
|
||||
# is thought for small snippets of JavaScript code, along the lines of
|
||||
# facilitates the inclusion of small snippets of JavaScript code, along the lines of
|
||||
# <tt>controllers/application.rb</tt> and <tt>helpers/application_helper.rb</tt>.
|
||||
def javascript_include_tag(*sources)
|
||||
options = sources.last.is_a?(Hash) ? sources.pop.stringify_keys : { }
|
||||
@ -103,7 +103,7 @@ def image_path(source)
|
||||
compute_public_path(source, 'images', 'png')
|
||||
end
|
||||
|
||||
# Returns an image tag converting the +options+ instead html options on the tag, but with these special cases:
|
||||
# Returns an image tag converting the +options+ into html options on the tag, but with these special cases:
|
||||
#
|
||||
# * <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"
|
||||
|
@ -13,7 +13,7 @@ module Helpers
|
||||
module DateHelper
|
||||
DEFAULT_PREFIX = 'date' unless const_defined?('DEFAULT_PREFIX')
|
||||
|
||||
# Reports the approximate distance in time between to Time objects or integers.
|
||||
# Reports the approximate distance in time between two Time objects or integers.
|
||||
# For example, if the distance is 47 minutes, it'll return
|
||||
# "about 1 hour". See the source for the complete wording list.
|
||||
#
|
||||
@ -56,7 +56,7 @@ def time_ago_in_words(from_time, include_seconds = false)
|
||||
|
||||
# Returns a set of select tags (one for year, month, and day) pre-selected for accessing a specified date-based attribute (identified by
|
||||
# +method+) on an object assigned to the template (identified by +object+). It's possible to tailor the selects through the +options+ hash,
|
||||
# which both accepts all the keys that each of the individual select builders does (like :use_month_numbers for select_month) and a range of
|
||||
# which accepts all the keys that each of the individual select builders do (like :use_month_numbers for select_month) as well as a range of
|
||||
# discard options. The discard options are <tt>:discard_year</tt>, <tt>:discard_month</tt> and <tt>:discard_day</tt>. Set to true, they'll
|
||||
# drop the respective select. Discarding the month select will also automatically discard the day select. It's also possible to explicitly
|
||||
# set the order of the tags using the <tt>:order</tt> option with an array of symbols <tt>:year</tt>, <tt>:month</tt> and <tt>:day</tt> in
|
||||
@ -96,7 +96,7 @@ def select_date(date = Date.today, options = {})
|
||||
select_year(date, options) + select_month(date, options) + select_day(date, options)
|
||||
end
|
||||
|
||||
# Returns a set of html select-tags (one for year, month, day, hour, and minute) preselected the +datetime+.
|
||||
# Returns a set of html select-tags (one for year, month, day, hour, and minute) pre-selected with the +datetime+.
|
||||
def select_datetime(datetime = Time.now, options = {})
|
||||
select_year(datetime, options) + select_month(datetime, options) + select_day(datetime, options) +
|
||||
select_hour(datetime, options) + select_minute(datetime, options)
|
||||
|
@ -76,17 +76,17 @@ def text_field(object, method, options = {})
|
||||
InstanceTag.new(object, method, self).to_input_field_tag("text", options)
|
||||
end
|
||||
|
||||
# Works just like text_field, but returns a input tag of the "password" type instead.
|
||||
# Works just like text_field, but returns an input tag of the "password" type instead.
|
||||
def password_field(object, method, options = {})
|
||||
InstanceTag.new(object, method, self).to_input_field_tag("password", options)
|
||||
end
|
||||
|
||||
# Works just like text_field, but returns a input tag of the "hidden" type instead.
|
||||
# Works just like text_field, but returns an input tag of the "hidden" type instead.
|
||||
def hidden_field(object, method, options = {})
|
||||
InstanceTag.new(object, method, self).to_input_field_tag("hidden", options)
|
||||
end
|
||||
|
||||
# Works just like text_field, but returns a input tag of the "file" type instead, which won't have any default value.
|
||||
# Works just like text_field, but returns an input tag of the "file" type instead, which won't have a default value.
|
||||
def file_field(object, method, options = {})
|
||||
InstanceTag.new(object, method, self).to_input_field_tag("file", options)
|
||||
end
|
||||
|
@ -127,11 +127,11 @@ def options_for_select(container, selected = nil)
|
||||
options_for_select.join("\n")
|
||||
end
|
||||
|
||||
# Returns a string of option tags that has been compiled by iterating over the +collection+ and assigning the
|
||||
# Returns a string of option tags that have been compiled by iterating over the +collection+ and assigning the
|
||||
# the result of a call to the +value_method+ as the option value and the +text_method+ as the option text.
|
||||
# If +selected_value+ is specified, the element returning a match on +value_method+ will get the selected option tag.
|
||||
#
|
||||
# Example (call, result). Imagine a loop iterating over each +person+ in <tt>@project.people</tt> to generate a input tag:
|
||||
# Example (call, result). Imagine a loop iterating over each +person+ in <tt>@project.people</tt> to generate an input tag:
|
||||
# options_from_collection_for_select(@project.people, "id", "name")
|
||||
# <option value="#{person.id}">#{person.name}</option>
|
||||
#
|
||||
@ -143,7 +143,7 @@ def options_from_collection_for_select(collection, value_method, text_method, se
|
||||
)
|
||||
end
|
||||
|
||||
# Returns a string of option tags, like options_from_collection_for_select, but surrounds them by <optgroup> tags.
|
||||
# Returns a string of option tags, like options_from_collection_for_select, but surrounds them with <optgroup> tags.
|
||||
#
|
||||
# An array of group objects are passed. Each group should return an array of options when calling group_method
|
||||
# Each group should should return its name when calling group_label_method.
|
||||
|
@ -3,8 +3,8 @@
|
||||
module ActionView
|
||||
module Helpers
|
||||
# Provides a set of helpers for creating JavaScript macros that rely on and often bundle methods from JavaScriptHelper into
|
||||
# larger units. These macros also rely on counter parts in the controller that provides them with their backing. The in-place
|
||||
# editing relies on ActionController::Base.in_place_edit_for and the auto completion relies on
|
||||
# larger units. These macros also rely on counterparts in the controller that provide them with their backing. The in-place
|
||||
# editing relies on ActionController::Base.in_place_edit_for and the autocompletion relies on
|
||||
# ActionController::Base.auto_complete_for.
|
||||
module JavaScriptMacrosHelper
|
||||
# Makes an HTML element specified by the DOM ID +field_id+ become an in-place
|
||||
@ -52,7 +52,7 @@ def in_place_editor(field_id, options = {})
|
||||
javascript_tag(function)
|
||||
end
|
||||
|
||||
# Renders the value of the specified object and method with in place editing capabilities.
|
||||
# Renders the value of the specified object and method with in-place editing capabilities.
|
||||
#
|
||||
# See the RDoc on ActionController::InPlaceEditing to learn more about this.
|
||||
def in_place_editor_field(object, method, tag_options = {}, in_place_editor_options = {})
|
||||
@ -88,9 +88,9 @@ def in_place_editor_field(object, method, tag_options = {}, in_place_editor_opti
|
||||
# <tt>:indicator</tt>:: Specifies the DOM ID of an element which will be
|
||||
# displayed while autocomplete is running.
|
||||
# <tt>:tokens</tt>:: A string or an array of strings containing
|
||||
# seperator tokens for tokenized incremental
|
||||
# separator tokens for tokenized incremental
|
||||
# autocompletion. Example: <tt>:tokens => ','</tt> would
|
||||
# allow multiple autocompletion entries, seperated
|
||||
# allow multiple autocompletion entries, separated
|
||||
# by commas.
|
||||
# <tt>:min_chars</tt>:: The minimum number of characters that should be
|
||||
# in the input field before an Ajax call is made
|
||||
@ -121,7 +121,7 @@ def auto_complete_field(field_id, options = {})
|
||||
javascript_tag(function)
|
||||
end
|
||||
|
||||
# Use this method in your view to generate a return for the AJAX automplete requests.
|
||||
# Use this method in your view to generate a return for the AJAX autocomplete requests.
|
||||
#
|
||||
# Example action:
|
||||
#
|
||||
|
@ -4,8 +4,8 @@ module Helpers
|
||||
# one of the following forms: phone number, percentage, money, or precision level.
|
||||
module NumberHelper
|
||||
|
||||
# Formats a +number+ into a US phone number string. The +options+ can be hash used to customize the format of the output.
|
||||
# The area code can be surrounded by parenthesis by setting +:area_code+ to true; default is false
|
||||
# Formats a +number+ into a US phone number string. The +options+ can be a hash used to customize the format of the output.
|
||||
# The area code can be surrounded by parentheses by setting +:area_code+ to true; default is false
|
||||
# The delimiter can be set using +:delimiter+; default is "-"
|
||||
# Examples:
|
||||
# number_to_phone(1235551234) => 123-555-1234
|
||||
@ -25,7 +25,7 @@ def number_to_phone(number, options = {})
|
||||
end
|
||||
end
|
||||
|
||||
# Formates a +number+ into a currency string. The +options+ hash can be used to customize the format of the output.
|
||||
# Formats a +number+ into a currency string. The +options+ hash can be used to customize the format of the output.
|
||||
# The +number+ can contain a level of precision using the +precision+ key; default is 2
|
||||
# The currency type can be set using the +unit+ key; default is "$"
|
||||
# The unit separator can be set using the +separator+ key; default is "."
|
||||
|
@ -3,14 +3,14 @@
|
||||
module ActionView
|
||||
module Helpers #:nodoc:
|
||||
# Provides a set of methods for working with text strings that can help unburden the level of inline Ruby code in the
|
||||
# templates. In the example below we iterate over a collection of posts provided to the template and prints each title
|
||||
# templates. In the example below we iterate over a collection of posts provided to the template and print each title
|
||||
# after making sure it doesn't run longer than 20 characters:
|
||||
# <% for post in @posts %>
|
||||
# Title: <%= truncate(post.title, 20) %>
|
||||
# <% end %>
|
||||
module TextHelper
|
||||
# The regular puts and print are outlawed in eRuby. It's recommended to use the <%= "hello" %> form instead of print "hello".
|
||||
# If you absolutely must use a method-based output, you can use concat. It's use like this <% concat "hello", binding %>. Notice that
|
||||
# If you absolutely must use a method-based output, you can use concat. It's used like this: <% concat "hello", binding %>. Notice that
|
||||
# it doesn't have an equal sign in front. Using <%= concat "hello" %> would result in a double hello.
|
||||
def concat(string, binding)
|
||||
eval("_erbout", binding).concat(string)
|
||||
@ -115,7 +115,7 @@ def markdown(text)
|
||||
# We can't really help what's not there
|
||||
end
|
||||
|
||||
# Returns +text+ transformed into html using very simple formatting rules
|
||||
# Returns +text+ transformed into HTML using very simple formatting rules
|
||||
# Surrounds paragraphs with <tt><p></tt> tags, and converts line breaks into <tt><br /></tt>
|
||||
# Two consecutive newlines(<tt>\n\n</tt>) are considered as a paragraph, one newline (<tt>\n</tt>) is
|
||||
# considered a linebreak, three or more consecutive newlines are turned into two newlines
|
||||
|
Loading…
Reference in New Issue
Block a user