Permalink
Browse files

Merge branch 'master' of github.com:lifo/docrails

Conflicts:
	guides/source/action_mailer_basics.md
  • Loading branch information...
2 parents a24ef86 + 8a347d9 commit b15ce4a006756a0b6cacfb9593d88c9a7dfd8eb0 @vijaydev vijaydev committed Apr 11, 2013
Showing with 421 additions and 289 deletions.
  1. +10 −5 actionpack/lib/action_view/helpers/asset_tag_helper.rb
  2. +25 −0 actionpack/lib/action_view/helpers/number_helper.rb
  3. +2 −2 actionpack/lib/action_view/helpers/tags/base.rb
  4. +1 −1 actionpack/lib/action_view/helpers/tags/check_box.rb
  5. +2 −2 actionpack/lib/action_view/helpers/tags/checkable.rb
  6. +3 −3 actionpack/lib/action_view/helpers/tags/collection_check_boxes.rb
  7. +3 −3 actionpack/lib/action_view/helpers/tags/collection_helpers.rb
  8. +3 −3 actionpack/lib/action_view/helpers/tags/collection_radio_buttons.rb
  9. +1 −1 actionpack/lib/action_view/helpers/tags/collection_select.rb
  10. +2 −2 actionpack/lib/action_view/helpers/tags/color_field.rb
  11. +2 −2 actionpack/lib/action_view/helpers/tags/date_field.rb
  12. +2 −2 actionpack/lib/action_view/helpers/tags/date_select.rb
  13. +2 −2 actionpack/lib/action_view/helpers/tags/datetime_field.rb
  14. +2 −2 actionpack/lib/action_view/helpers/tags/datetime_local_field.rb
  15. +2 −2 actionpack/lib/action_view/helpers/tags/datetime_select.rb
  16. +2 −2 actionpack/lib/action_view/helpers/tags/email_field.rb
  17. +2 −2 actionpack/lib/action_view/helpers/tags/file_field.rb
  18. +2 −2 actionpack/lib/action_view/helpers/tags/grouped_collection_select.rb
  19. +2 −2 actionpack/lib/action_view/helpers/tags/hidden_field.rb
  20. +2 −2 actionpack/lib/action_view/helpers/tags/label.rb
  21. +2 −2 actionpack/lib/action_view/helpers/tags/month_field.rb
  22. +2 −2 actionpack/lib/action_view/helpers/tags/number_field.rb
  23. +2 −2 actionpack/lib/action_view/helpers/tags/password_field.rb
  24. +2 −2 actionpack/lib/action_view/helpers/tags/radio_button.rb
  25. +2 −2 actionpack/lib/action_view/helpers/tags/range_field.rb
  26. +2 −2 actionpack/lib/action_view/helpers/tags/search_field.rb
  27. +2 −3 actionpack/lib/action_view/helpers/tags/select.rb
  28. +2 −2 actionpack/lib/action_view/helpers/tags/tel_field.rb
  29. +2 −2 actionpack/lib/action_view/helpers/tags/text_area.rb
  30. +2 −2 actionpack/lib/action_view/helpers/tags/text_field.rb
  31. +2 −2 actionpack/lib/action_view/helpers/tags/time_field.rb
  32. +2 −2 actionpack/lib/action_view/helpers/tags/time_select.rb
  33. +2 −2 actionpack/lib/action_view/helpers/tags/time_zone_select.rb
  34. +2 −2 actionpack/lib/action_view/helpers/tags/url_field.rb
  35. +2 −2 actionpack/lib/action_view/helpers/tags/week_field.rb
  36. +8 −5 actionpack/lib/action_view/helpers/text_helper.rb
  37. +1 −1 activerecord/lib/active_record/associations/association.rb
  38. +2 −2 activerecord/lib/active_record/associations/collection_proxy.rb
  39. +1 −1 activerecord/lib/active_record/associations/join_dependency/join_part.rb
  40. +7 −0 activerecord/lib/active_record/attribute_methods/serialization.rb
  41. +1 −1 activerecord/lib/active_record/migration.rb
  42. +6 −1 activerecord/lib/active_record/reflection.rb
  43. +1 −2 activerecord/lib/active_record/relation/query_methods.rb
  44. +3 −3 activesupport/CHANGELOG.md
  45. +5 −3 activesupport/lib/active_support/core_ext/array/conversions.rb
  46. +2 −2 activesupport/lib/active_support/core_ext/array/uniq_by.rb
  47. +7 −0 activesupport/lib/active_support/core_ext/benchmark.rb
  48. BIN guides/assets/images/getting_started/unknown_action_create_for_posts.png
  49. +1 −1 guides/source/4_0_release_notes.md
  50. +14 −13 guides/source/action_controller_overview.md
  51. +10 −15 guides/source/action_mailer_basics.md
  52. +2 −7 guides/source/action_view_overview.md
  53. +98 −95 guides/source/active_record_basics.md
  54. +2 −2 guides/source/caching_with_rails.md
  55. +2 −2 guides/source/command_line.md
  56. +1 −1 guides/source/configuring.md
  57. +1 −1 guides/source/credits.html.erb
  58. +1 −4 guides/source/debugging_rails_applications.md
  59. +5 −0 guides/source/documents.yaml
  60. +14 −14 guides/source/engines.md
  61. +2 −5 guides/source/form_helpers.md
  62. +9 −8 guides/source/getting_started.md
  63. +22 −0 guides/source/i18n.md
  64. +57 −2 guides/source/layouts_and_rendering.md
  65. +11 −11 guides/source/rails_application_templates.md
  66. +8 −5 guides/source/rails_on_rack.md
  67. +6 −0 guides/source/routing.md
  68. +7 −7 guides/source/testing.md
  69. +2 −2 guides/source/upgrading_ruby_on_rails.md
@@ -14,7 +14,6 @@ module Helpers #:nodoc:
# # => <img alt="Rails" src="/assets/rails.png" />
# stylesheet_link_tag("application")
# # => <link href="/assets/application.css?body=1" media="screen" rel="stylesheet" />
- #
module AssetTagHelper
extend ActiveSupport::Concern
@@ -50,7 +49,6 @@ module AssetTagHelper
#
# javascript_include_tag "http://www.example.com/xmlhr.js"
# # => <script src="http://www.example.com/xmlhr.js"></script>
- #
def javascript_include_tag(*sources)
options = sources.extract_options!.stringify_keys
path_options = options.extract!('protocol').symbolize_keys
@@ -67,7 +65,7 @@ def javascript_include_tag(*sources)
# you don't specify an extension, <tt>.css</tt> will be appended automatically.
# You can modify the link attributes by passing a hash as the last argument.
# For historical reasons, the 'media' attribute will always be present and defaults
- # to "screen", so you must explicitely set it to "all" for the stylesheet(s) to
+ # to "screen", so you must explicitly set it to "all" for the stylesheet(s) to
# apply to all media types.
#
# stylesheet_link_tag "style"
@@ -88,7 +86,6 @@ def javascript_include_tag(*sources)
# stylesheet_link_tag "random.styles", "/css/stylish"
# # => <link href="/assets/random.styles" media="screen" rel="stylesheet" />
# # <link href="/css/stylish.css" media="screen" rel="stylesheet" />
- #
def stylesheet_link_tag(*sources)
options = sources.extract_options!.stringify_keys
path_options = options.extract!('protocol').symbolize_keys
@@ -109,10 +106,13 @@ def stylesheet_link_tag(*sources)
# +url_options+. You can modify the LINK tag itself in +tag_options+.
#
# ==== Options
+ #
# * <tt>:rel</tt> - Specify the relation of this link, defaults to "alternate"
# * <tt>:type</tt> - Override the auto-generated mime type
# * <tt>:title</tt> - Specify the title of the link, defaults to the +type+
#
+ # ==== Examples
+ #
# auto_discovery_link_tag
# # => <link rel="alternate" type="application/rss+xml" title="RSS" href="http://www.currenthost.com/controller/action" />
# auto_discovery_link_tag(:atom)
@@ -148,9 +148,12 @@ def auto_discovery_link_tag(type = :rss, url_options = {}, tag_options = {})
# you can override "rel" and "type".
#
# ==== Options
+ #
# * <tt>:rel</tt> - Specify the relation of this link, defaults to 'shortcut icon'
# * <tt>:type</tt> - Override the auto-generated mime type, defaults to 'image/vnd.microsoft.icon'
#
+ # ==== Examples
+ #
# favicon_link_tag '/myicon.ico'
# # => <link href="/assets/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
#
@@ -160,7 +163,6 @@ def auto_discovery_link_tag(type = :rss, url_options = {}, tag_options = {})
#
# favicon_link_tag '/mb-icon.png', rel: 'apple-touch-icon', type: 'image/png'
# # => <link href="/assets/mb-icon.png" rel="apple-touch-icon" type="image/png" />
- #
def favicon_link_tag(source='favicon.ico', options={})
tag('link', {
:rel => 'shortcut icon',
@@ -173,6 +175,7 @@ def favicon_link_tag(source='favicon.ico', options={})
# path or a file.
#
# ==== Options
+ #
# You can add HTML attributes using the +options+. The +options+ supports
# three additional keys for convenience and conformance:
#
@@ -250,6 +253,8 @@ def image_alt(src)
# width="30" and height="45". <tt>:size</tt> will be ignored if the
# value is not in the correct format.
#
+ # ==== Examples
+ #
# video_tag("trailer")
# # => <video src="/videos/trailer" />
# video_tag("trailer.ogg")
@@ -28,6 +28,8 @@ def initialize(number)
# Formats a +number+ into a US phone number (e.g., (555)
# 123-9876). You can customize the format in the +options+ hash.
#
+ # ==== Options
+ #
# * <tt>:area_code</tt> - Adds parentheses around the area code.
# * <tt>:delimiter</tt> - Specifies the delimiter to use
# (defaults to "-").
@@ -38,6 +40,8 @@ def initialize(number)
# * <tt>:raise</tt> - If true, raises +InvalidNumberError+ when
# the argument is invalid.
#
+ # ==== Examples
+ #
# number_to_phone(5551234) # => 555-1234
# number_to_phone("5551234") # => 555-1234
# number_to_phone(1235551234) # => 123-555-1234
@@ -61,6 +65,8 @@ def number_to_phone(number, options = {})
# Formats a +number+ into a currency string (e.g., $13.65). You
# can customize the format in the +options+ hash.
#
+ # ==== Options
+ #
# * <tt>:locale</tt> - Sets the locale to be used for formatting
# (defaults to current locale).
# * <tt>:precision</tt> - Sets the level of precision (defaults
@@ -82,6 +88,8 @@ def number_to_phone(number, options = {})
# * <tt>:raise</tt> - If true, raises +InvalidNumberError+ when
# the argument is invalid.
#
+ # ==== Examples
+ #
# number_to_currency(1234567890.50) # => $1,234,567,890.50
# number_to_currency(1234567890.506) # => $1,234,567,890.51
# number_to_currency(1234567890.506, precision: 3) # => $1,234,567,890.506
@@ -108,6 +116,7 @@ def number_to_currency(number, options = {})
# Formats a +number+ as a percentage string (e.g., 65%). You can
# customize the format in the +options+ hash.
#
+ # ==== Options
#
# * <tt>:locale</tt> - Sets the locale to be used for formatting
# (defaults to current locale).
@@ -128,6 +137,8 @@ def number_to_currency(number, options = {})
# * <tt>:raise</tt> - If true, raises +InvalidNumberError+ when
# the argument is invalid.
#
+ # ==== Examples
+ #
# number_to_percentage(100) # => 100.000%
# number_to_percentage("98") # => 98.000%
# number_to_percentage(100, precision: 0) # => 100%
@@ -151,6 +162,8 @@ def number_to_percentage(number, options = {})
# (e.g., 12,324). You can customize the format in the +options+
# hash.
#
+ # ==== Options
+ #
# * <tt>:locale</tt> - Sets the locale to be used for formatting
# (defaults to current locale).
# * <tt>:delimiter</tt> - Sets the thousands delimiter (defaults
@@ -160,6 +173,8 @@ def number_to_percentage(number, options = {})
# * <tt>:raise</tt> - If true, raises +InvalidNumberError+ when
# the argument is invalid.
#
+ # ==== Examples
+ #
# number_with_delimiter(12345678) # => 12,345,678
# number_with_delimiter("123456") # => 123,456
# number_with_delimiter(12345678.05) # => 12,345,678.05
@@ -185,6 +200,8 @@ def number_with_delimiter(number, options = {})
# +:significant+ is +false+, and 5 if +:significant+ is +true+).
# You can customize the format in the +options+ hash.
#
+ # ==== Options
+ #
# * <tt>:locale</tt> - Sets the locale to be used for formatting
# (defaults to current locale).
# * <tt>:precision</tt> - Sets the precision of the number
@@ -202,6 +219,8 @@ def number_with_delimiter(number, options = {})
# * <tt>:raise</tt> - If true, raises +InvalidNumberError+ when
# the argument is invalid.
#
+ # ==== Examples
+ #
# number_with_precision(111.2345) # => 111.235
# number_with_precision(111.2345, precision: 2) # => 111.23
# number_with_precision(13, precision: 5) # => 13.00000
@@ -233,6 +252,8 @@ def number_with_precision(number, options = {})
# See <tt>number_to_human</tt> if you want to pretty-print a
# generic number.
#
+ # ==== Options
+ #
# * <tt>:locale</tt> - Sets the locale to be used for formatting
# (defaults to current locale).
# * <tt>:precision</tt> - Sets the precision of the number
@@ -252,6 +273,8 @@ def number_with_precision(number, options = {})
# * <tt>:raise</tt> - If true, raises +InvalidNumberError+ when
# the argument is invalid.
#
+ # ==== Examples
+ #
# number_to_human_size(123) # => 123 Bytes
# number_to_human_size(1234) # => 1.21 KB
# number_to_human_size(12345) # => 12.1 KB
@@ -324,6 +347,8 @@ def number_to_human_size(number, options = {})
# * <tt>:raise</tt> - If true, raises +InvalidNumberError+ when
# the argument is invalid.
#
+ # ==== Examples
+ #
# number_to_human(123) # => "123"
# number_to_human(1234) # => "1.23 Thousand"
# number_to_human(12345) # => "12.3 Thousand"
@@ -1,7 +1,7 @@
module ActionView
module Helpers
- module Tags
- class Base #:nodoc:
+ module Tags # :nodoc:
+ class Base # :nodoc:
include Helpers::ActiveModelInstanceTag, Helpers::TagHelper, Helpers::FormTagHelper
include FormOptionsHelper
@@ -2,7 +2,7 @@
module ActionView
module Helpers
- module Tags
+ module Tags # :nodoc:
class CheckBox < Base #:nodoc:
include Checkable
@@ -1,7 +1,7 @@
module ActionView
module Helpers
- module Tags
- module Checkable
+ module Tags # :nodoc:
+ module Checkable # :nodoc:
def input_checked?(object, options)
if options.has_key?("checked")
checked = options.delete "checked"
@@ -2,11 +2,11 @@
module ActionView
module Helpers
- module Tags
- class CollectionCheckBoxes < Base
+ module Tags # :nodoc:
+ class CollectionCheckBoxes < Base # :nodoc:
include CollectionHelpers
- class CheckBoxBuilder < Builder
+ class CheckBoxBuilder < Builder # :nodoc:
def check_box(extra_html_options={})
html_options = extra_html_options.merge(@input_html_options)
@template_object.check_box(@object_name, @method_name, html_options, @value, nil)
@@ -1,8 +1,8 @@
module ActionView
module Helpers
- module Tags
- module CollectionHelpers
- class Builder
+ module Tags # :nodoc:
+ module CollectionHelpers # :nodoc:
+ class Builder # :nodoc:
attr_reader :object, :text, :value
def initialize(template_object, object_name, method_name, object,
@@ -2,11 +2,11 @@
module ActionView
module Helpers
- module Tags
- class CollectionRadioButtons < Base
+ module Tags # :nodoc:
+ class CollectionRadioButtons < Base # :nodoc:
include CollectionHelpers
- class RadioButtonBuilder < Builder
+ class RadioButtonBuilder < Builder # :nodoc:
def radio_button(extra_html_options={})
html_options = extra_html_options.merge(@input_html_options)
@template_object.radio_button(@object_name, @method_name, @value, html_options)
@@ -1,6 +1,6 @@
module ActionView
module Helpers
- module Tags
+ module Tags # :nodoc:
class CollectionSelect < Base #:nodoc:
def initialize(object_name, method_name, template_object, collection, value_method, text_method, options, html_options)
@collection = collection
@@ -1,7 +1,7 @@
module ActionView
module Helpers
- module Tags
- class ColorField < TextField #:nodoc:
+ module Tags # :nodoc:
+ class ColorField < TextField # :nodoc:
def render
options = @options.stringify_keys
options["value"] = @options.fetch("value") { validate_color_string(value(object)) }
@@ -1,7 +1,7 @@
module ActionView
module Helpers
- module Tags
- class DateField < DatetimeField #:nodoc:
+ module Tags # :nodoc:
+ class DateField < DatetimeField # :nodoc:
private
def format_date(value)
@@ -2,8 +2,8 @@
module ActionView
module Helpers
- module Tags
- class DateSelect < Base #:nodoc:
+ module Tags # :nodoc:
+ class DateSelect < Base # :nodoc:
def initialize(object_name, method_name, template_object, options, html_options)
@html_options = html_options
@@ -1,7 +1,7 @@
module ActionView
module Helpers
- module Tags
- class DatetimeField < TextField #:nodoc:
+ module Tags # :nodoc:
+ class DatetimeField < TextField # :nodoc:
def render
options = @options.stringify_keys
options["value"] = @options.fetch("value") { format_date(value(object)) }
@@ -1,7 +1,7 @@
module ActionView
module Helpers
- module Tags
- class DatetimeLocalField < DatetimeField #:nodoc:
+ module Tags # :nodoc:
+ class DatetimeLocalField < DatetimeField # :nodoc:
class << self
def field_type
@field_type ||= "datetime-local"
@@ -1,7 +1,7 @@
module ActionView
module Helpers
- module Tags
- class DatetimeSelect < DateSelect #:nodoc:
+ module Tags # :nodoc:
+ class DatetimeSelect < DateSelect # :nodoc:
end
end
end
@@ -1,7 +1,7 @@
module ActionView
module Helpers
- module Tags
- class EmailField < TextField #:nodoc:
+ module Tags # :nodoc:
+ class EmailField < TextField # :nodoc:
end
end
end
@@ -1,7 +1,7 @@
module ActionView
module Helpers
- module Tags
- class FileField < TextField #:nodoc:
+ module Tags # :nodoc:
+ class FileField < TextField # :nodoc:
end
end
end
@@ -1,7 +1,7 @@
module ActionView
module Helpers
- module Tags
- class GroupedCollectionSelect < Base #:nodoc:
+ module Tags # :nodoc:
+ class GroupedCollectionSelect < Base # :nodoc:
def initialize(object_name, method_name, template_object, collection, group_method, group_label_method, option_key_method, option_value_method, options, html_options)
@collection = collection
@group_method = group_method
@@ -1,7 +1,7 @@
module ActionView
module Helpers
- module Tags
- class HiddenField < TextField #:nodoc:
+ module Tags # :nodoc:
+ class HiddenField < TextField # :nodoc:
end
end
end
@@ -1,7 +1,7 @@
module ActionView
module Helpers
- module Tags
- class Label < Base #:nodoc:
+ module Tags # :nodoc:
+ class Label < Base # :nodoc:
def initialize(object_name, method_name, template_object, content_or_options = nil, options = nil)
options ||= {}
Oops, something went wrong.

0 comments on commit b15ce4a

Please sign in to comment.