From 3cd422fece1b659b4cc6168682cb5a1ec6bcdb66 Mon Sep 17 00:00:00 2001 From: yui-knk Date: Sun, 19 Apr 2015 23:38:46 +0900 Subject: [ci skip] Fix returned values of code sample --- guides/source/active_support_core_extensions.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/guides/source/active_support_core_extensions.md b/guides/source/active_support_core_extensions.md index ff60f95a2c..ef4e0318c5 100644 --- a/guides/source/active_support_core_extensions.md +++ b/guides/source/active_support_core_extensions.md @@ -2201,14 +2201,14 @@ Extensions to `Array` Active Support augments the API of arrays to ease certain ways of accessing them. For example, `to` returns the subarray of elements up to the one at the passed index: ```ruby -%w(a b c d).to(2) # => %w(a b c) +%w(a b c d).to(2) # => ["a", "b", "c"] [].to(7) # => [] ``` Similarly, `from` returns the tail from the element at the passed index to the end. If the index is greater than the length of the array, it returns an empty array. ```ruby -%w(a b c d).from(2) # => %w(c d) +%w(a b c d).from(2) # => ["c", "d"] %w(a b c d).from(10) # => [] [].from(0) # => [] ``` @@ -2216,7 +2216,7 @@ Similarly, `from` returns the tail from the element at the passed index to the e The methods `second`, `third`, `fourth`, and `fifth` return the corresponding element (`first` is built-in). Thanks to social wisdom and positive constructiveness all around, `forty_two` is also available. ```ruby -%w(a b c d).third # => c +%w(a b c d).third # => "c" %w(a b c d).fifth # => nil ``` @@ -2229,7 +2229,7 @@ NOTE: Defined in `active_support/core_ext/array/access.rb`. This method is an alias of `Array#unshift`. ```ruby -%w(a b c d).prepend('e') # => %w(e a b c d) +%w(a b c d).prepend('e') # => ["e", "a", "b", "c", "d"] [].prepend(10) # => [10] ``` @@ -2240,8 +2240,8 @@ NOTE: Defined in `active_support/core_ext/array/prepend_and_append.rb`. This method is an alias of `Array#<<`. ```ruby -%w(a b c d).append('e') # => %w(a b c d e) -[].append([1,2]) # => [[1,2]] +%w(a b c d).append('e') # => ["a", "b", "c", "d", "e"] +[].append([1,2]) # => [[1, 2]] ``` NOTE: Defined in `active_support/core_ext/array/prepend_and_append.rb`. -- cgit v1.2.3 From 23fc9980efb8627121549f091c58f961f1318de1 Mon Sep 17 00:00:00 2001 From: yui-knk Date: Tue, 21 Apr 2015 21:44:03 +0900 Subject: [ci skip] `deep_dup` is instance method of `Array` --- guides/source/active_support_core_extensions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/source/active_support_core_extensions.md b/guides/source/active_support_core_extensions.md index ef4e0318c5..155c53775e 100644 --- a/guides/source/active_support_core_extensions.md +++ b/guides/source/active_support_core_extensions.md @@ -2465,7 +2465,7 @@ NOTE: Defined in `active_support/core_ext/array/wrap.rb`. ### Duplicating -The method `Array.deep_dup` duplicates itself and all objects inside +The method `Array#deep_dup` duplicates itself and all objects inside recursively with Active Support method `Object#deep_dup`. It works like `Array#map` with sending `deep_dup` method to each object inside. ```ruby -- cgit v1.2.3 From 571e8bc98c7ae4e209ac87010706e3bd7120f787 Mon Sep 17 00:00:00 2001 From: yui-knk Date: Wed, 22 Apr 2015 09:54:40 +0900 Subject: [ci skip] `deep_dup` is instance method of `Hash` --- guides/source/active_support_core_extensions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/source/active_support_core_extensions.md b/guides/source/active_support_core_extensions.md index 155c53775e..4e8e95257e 100644 --- a/guides/source/active_support_core_extensions.md +++ b/guides/source/active_support_core_extensions.md @@ -2687,7 +2687,7 @@ NOTE: Defined in `active_support/core_ext/hash/deep_merge.rb`. ### Deep duplicating -The method `Hash.deep_dup` duplicates itself and all keys and values +The method `Hash#deep_dup` duplicates itself and all keys and values inside recursively with Active Support method `Object#deep_dup`. It works like `Enumerator#each_with_object` with sending `deep_dup` method to each pair inside. ```ruby -- cgit v1.2.3 From 16c51bc84a4ad1864949ef97e8d3739020863871 Mon Sep 17 00:00:00 2001 From: Mikhail Dieterle Date: Thu, 23 Apr 2015 09:10:40 +0300 Subject: [ci skip] fix count of options for `find_each` --- guides/source/active_record_querying.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/source/active_record_querying.md b/guides/source/active_record_querying.md index de976acd01..fe6418deb8 100644 --- a/guides/source/active_record_querying.md +++ b/guides/source/active_record_querying.md @@ -317,7 +317,7 @@ end The `find_each` method accepts most of the options allowed by the regular `find` method, except for `:order` and `:limit`, which are reserved for internal use by `find_each`. -Two additional options, `:batch_size` and `:begin_at`, are available as well. +Three additional options, `:batch_size`, `:begin_at` and `:end_at`, are available as well. **`:batch_size`** -- cgit v1.2.3 From 3379ebc27057e72a7d18dff9929c288d5f884652 Mon Sep 17 00:00:00 2001 From: Prathamesh Sonpatki Date: Sat, 25 Apr 2015 16:02:39 +0530 Subject: Fix method name for building associated object in nested_model_forms guide --- guides/source/nested_model_forms.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/source/nested_model_forms.md b/guides/source/nested_model_forms.md index 1937369776..121cf2b185 100644 --- a/guides/source/nested_model_forms.md +++ b/guides/source/nested_model_forms.md @@ -106,7 +106,7 @@ Consider the following typical RESTful controller which will prepare a new Perso class PeopleController < ApplicationController def new @person = Person.new - @person.built_address + @person.build_address 2.times { @person.projects.build } end -- cgit v1.2.3 From 1b61fb44e4e7d373cd63a51e04e683df77263f09 Mon Sep 17 00:00:00 2001 From: Hendy Tanata Date: Mon, 27 Apr 2015 18:43:59 -0700 Subject: Add missing "of" to RequestForgeryProtection doc. [ci skip] --- actionpack/lib/action_controller/metal/request_forgery_protection.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actionpack/lib/action_controller/metal/request_forgery_protection.rb b/actionpack/lib/action_controller/metal/request_forgery_protection.rb index 663a969f72..bc0e0089d0 100644 --- a/actionpack/lib/action_controller/metal/request_forgery_protection.rb +++ b/actionpack/lib/action_controller/metal/request_forgery_protection.rb @@ -19,7 +19,7 @@ module ActionController #:nodoc: # # Since HTML and Javascript requests are typically made from the browser, we # need to ensure to verify request authenticity for the web browser. We can - # use session-oriented authentication for these types requests, by using + # use session-oriented authentication for these types of requests, by using # the `protect_form_forgery` method in our controllers. # # GET requests are not protected since they don't have side effects like writing -- cgit v1.2.3 From a9319713685b73316e99459c7d32dcbe58aebb1d Mon Sep 17 00:00:00 2001 From: Prathamesh Sonpatki Date: Tue, 28 Apr 2015 13:41:44 +0530 Subject: Replaced Javascript with JavaScript in guides --- guides/source/getting_started.md | 2 +- guides/source/upgrading_ruby_on_rails.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md index db4e81e32e..f5bf89c56d 100644 --- a/guides/source/getting_started.md +++ b/guides/source/getting_started.md @@ -1491,7 +1491,7 @@ appear. ![Confirm Dialog](images/getting_started/confirm_dialog.png) TIP: Learn more about jQuery Unobtrusive Adapter (jQuery UJS) on -[Working With Javascript in Rails](working_with_javascript_in_rails.html) guide. +[Working With JavaScript in Rails](working_with_javascript_in_rails.html) guide. Congratulations, you can now create, show, list, update and destroy articles. diff --git a/guides/source/upgrading_ruby_on_rails.md b/guides/source/upgrading_ruby_on_rails.md index 7666601bd7..863af4771b 100644 --- a/guides/source/upgrading_ruby_on_rails.md +++ b/guides/source/upgrading_ruby_on_rails.md @@ -912,7 +912,7 @@ Rails 4.0 extracted Active Resource to its own gem. If you still need the featur Please note that you should wait to set `secret_key_base` until you have 100% of your userbase on Rails 4.x and are reasonably sure you will not need to rollback to Rails 3.x. This is because cookies signed based on the new `secret_key_base` in Rails 4.x are not backwards compatible with Rails 3.x. You are free to leave your existing `secret_token` in place, not set the new `secret_key_base`, and ignore the deprecation warnings until you are reasonably sure that your upgrade is otherwise complete. -If you are relying on the ability for external applications or Javascript to be able to read your Rails app's signed session cookies (or signed cookies in general) you should not set `secret_key_base` until you have decoupled these concerns. +If you are relying on the ability for external applications or JavaScript to be able to read your Rails app's signed session cookies (or signed cookies in general) you should not set `secret_key_base` until you have decoupled these concerns. * Rails 4.0 encrypts the contents of cookie-based sessions if `secret_key_base` has been set. Rails 3.x signed, but did not encrypt, the contents of cookie-based session. Signed cookies are "secure" in that they are verified to have been generated by your app and are tamper-proof. However, the contents can be viewed by end users, and encrypting the contents eliminates this caveat/concern without a significant performance penalty. -- cgit v1.2.3 From 33f83401ade58c1481071891f661c239358011a2 Mon Sep 17 00:00:00 2001 From: Prathamesh Sonpatki Date: Tue, 28 Apr 2015 15:46:35 +0530 Subject: Updated titles of headers in Action Mailer guide --- guides/source/action_mailer_basics.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guides/source/action_mailer_basics.md b/guides/source/action_mailer_basics.md index 73b240ff2c..058992ec0e 100644 --- a/guides/source/action_mailer_basics.md +++ b/guides/source/action_mailer_basics.md @@ -503,7 +503,7 @@ You will need to use: By using the full URL, your links will now work in your emails. -#### generating URLs with `url_for` +#### Generating URLs with `url_for` `url_for` generate full URL by default in templates. @@ -517,7 +517,7 @@ If you did not configure the `:host` option globally make sure to pass it to action: 'greeting') %> ``` -#### generating URLs with named routes +#### Generating URLs with Named Routes Email clients have no web context and so paths have no base URL to form complete web addresses. Thus, you should always use the "_url" variant of named route -- cgit v1.2.3 From 92c0af217446ec8f557f9d47a04a0d19fc58b4a5 Mon Sep 17 00:00:00 2001 From: yui-knk Date: Fri, 8 May 2015 21:37:17 +0900 Subject: [ci skip] Add an example to ActionView::Helpers::FormBuilder#label --- actionview/lib/action_view/helpers/form_helper.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/actionview/lib/action_view/helpers/form_helper.rb b/actionview/lib/action_view/helpers/form_helper.rb index ece117b547..fa4e836081 100644 --- a/actionview/lib/action_view/helpers/form_helper.rb +++ b/actionview/lib/action_view/helpers/form_helper.rb @@ -1668,6 +1668,7 @@ module ActionView # label(:post, :terms) do # 'Accept Terms.'.html_safe # end + # # => def label(method, text = nil, options = {}, &block) @template.label(@object_name, method, text, objectify_options(options), &block) end -- cgit v1.2.3