From f57fd2f5d5fe65412f4f5b9f13be1663de57938e Mon Sep 17 00:00:00 2001 From: Harshad Sabne Date: Thu, 4 Sep 2014 10:16:44 +0530 Subject: 'Reversible' ->active_record_migrations [ci skip] Reversible method documentation moved from migrations.md to active_record_migrations.md --- guides/source/4_0_release_notes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/source/4_0_release_notes.md b/guides/source/4_0_release_notes.md index 1aaf5ebc94..da212a3c9d 100644 --- a/guides/source/4_0_release_notes.md +++ b/guides/source/4_0_release_notes.md @@ -229,7 +229,7 @@ Please refer to the [Changelog](https://github.com/rails/rails/blob/4-0-stable/a The method `change_table` is also reversible, as long as its block doesn't call `remove`, `change` or `change_default` * New method `reversible` makes it possible to specify code to be run when migrating up or down. - See the [Guide on Migration](https://github.com/rails/rails/blob/master/guides/source/migrations.md#using-the-reversible-method) + See the [Guide on Migration](https://github.com/rails/rails/blob/master/guides/source/active_record_migrations.md#using-reversible) * New method `revert` will revert a whole migration or the given block. If migrating down, the given migration / block is run normally. -- cgit v1.2.3 From 72e42d2521935600d4eb5a96527133e0a14dbf45 Mon Sep 17 00:00:00 2001 From: Harshad Sabne Date: Sat, 6 Sep 2014 00:20:03 +0530 Subject: 'Revert' ->active_record_migrations [ci skip] Revert method documentation moved from migrations.md to active_record_migrations.md --- guides/source/4_0_release_notes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/source/4_0_release_notes.md b/guides/source/4_0_release_notes.md index da212a3c9d..84a65df2bc 100644 --- a/guides/source/4_0_release_notes.md +++ b/guides/source/4_0_release_notes.md @@ -233,7 +233,7 @@ Please refer to the [Changelog](https://github.com/rails/rails/blob/4-0-stable/a * New method `revert` will revert a whole migration or the given block. If migrating down, the given migration / block is run normally. - See the [Guide on Migration](https://github.com/rails/rails/blob/master/guides/source/migrations.md#reverting-previous-migrations) + See the [Guide on Migration](https://github.com/rails/rails/blob/master/guides/source/active_record_migrations.md#reverting-previous-migrations) * Adds PostgreSQL array type support. Any datatype can be used to create an array column, with full migration and schema dumper support. -- cgit v1.2.3 From 29366cdad7e11cb582602ff8f4342108d66bf235 Mon Sep 17 00:00:00 2001 From: Juanito Fatas Date: Mon, 8 Sep 2014 03:29:48 +0800 Subject: [ci skip] Fix some typos, normalize sentence. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow up of #16722. https://github.com/rails/rails/pull/16722 also normalize all instance gained methods’ sentence. --- guides/source/association_basics.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/guides/source/association_basics.md b/guides/source/association_basics.md index c9e0fcd939..61490ceb54 100644 --- a/guides/source/association_basics.md +++ b/guides/source/association_basics.md @@ -756,7 +756,7 @@ class Order < ActiveRecord::Base end ``` -Each instance of the order model will have these methods: +Each instance of the `Order` model will have these methods: ```ruby customer @@ -1342,16 +1342,16 @@ class Customer < ActiveRecord::Base end ``` -Each instance of the customer model will have these methods: +Each instance of the `Customer` model will have these methods: ```ruby orders(force_reload = false) orders<<(object, ...) orders.delete(object, ...) orders.destroy(object, ...) -orders=objects +orders=(objects) order_ids -order_ids=ids +order_ids=(ids) orders.clear orders.empty? orders.size @@ -1831,16 +1831,16 @@ class Part < ActiveRecord::Base end ``` -Each instance of the part model will have these methods: +Each instance of the `Part` model will have these methods: ```ruby assemblies(force_reload = false) assemblies<<(object, ...) assemblies.delete(object, ...) assemblies.destroy(object, ...) -assemblies=objects +assemblies=(objects) assembly_ids -assembly_ids=ids +assembly_ids=(ids) assemblies.clear assemblies.empty? assemblies.size -- cgit v1.2.3 From be83a1726b7cf0a8d1ffb80b957b3da6239cd6d1 Mon Sep 17 00:00:00 2001 From: Thiago Pinto Date: Sat, 13 Sep 2014 19:32:23 -0300 Subject: form_helpers: demonstrating there is also a collection_select method in form builder --- guides/source/form_helpers.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/guides/source/form_helpers.md b/guides/source/form_helpers.md index 9ced77dfd7..16fa23c129 100644 --- a/guides/source/form_helpers.md +++ b/guides/source/form_helpers.md @@ -506,6 +506,12 @@ As the name implies, this only generates option tags. To generate a working sele <%= collection_select(:person, :city_id, City.all, :id, :name) %> ``` +As with other helpers, if you were to use the collection_select helper on a form builder scoped to the @person object, the syntax would be: + +```erb +<%= f.collection_select(:city_id, City.all, :id, :name) %> +``` + To recap, `options_from_collection_for_select` is to `collection_select` what `options_for_select` is to `select`. NOTE: Pairs passed to `options_for_select` should have the name first and the id second, however with `options_from_collection_for_select` the first argument is the value method and the second the text method. -- cgit v1.2.3 From 49f8356f33382cdefa01a3fa2c400583d97f7279 Mon Sep 17 00:00:00 2001 From: Juanito Fatas Date: Tue, 16 Sep 2014 15:32:38 +0800 Subject: [ci skip] Fix code snippet display in Action Mailer Basics guide. --- guides/source/action_mailer_basics.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/guides/source/action_mailer_basics.md b/guides/source/action_mailer_basics.md index f981d0da47..f6c974c87a 100644 --- a/guides/source/action_mailer_basics.md +++ b/guides/source/action_mailer_basics.md @@ -298,8 +298,7 @@ Action Mailer 3.0 makes inline attachments, which involved a lot of hacking in p ```html+erb

Hello there, this is our image

- <%= image_tag attachments['image.jpg'].url, alt: 'My Photo', - class: 'photos' %> + <%= image_tag attachments['image.jpg'].url, alt: 'My Photo', class: 'photos' %> ``` #### Sending Email To Multiple Recipients -- cgit v1.2.3 From 221052104072dd5a15cac9f50dc2af0a10a883e2 Mon Sep 17 00:00:00 2001 From: Steven Harman Date: Tue, 16 Sep 2014 15:23:24 -0400 Subject: Consistently capitalize ETag. --- actionpack/lib/action_controller/metal/conditional_get.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/actionpack/lib/action_controller/metal/conditional_get.rb b/actionpack/lib/action_controller/metal/conditional_get.rb index a93727df90..f0e3e59282 100644 --- a/actionpack/lib/action_controller/metal/conditional_get.rb +++ b/actionpack/lib/action_controller/metal/conditional_get.rb @@ -13,9 +13,9 @@ module ActionController end module ClassMethods - # Allows you to consider additional controller-wide information when generating an etag. + # Allows you to consider additional controller-wide information when generating an ETag. # For example, if you serve pages tailored depending on who's logged in at the moment, you - # may want to add the current user id to be part of the etag to prevent authorized displaying + # may want to add the current user id to be part of the ETag to prevent authorized displaying # of cached pages. # # class InvoicesController < ApplicationController @@ -54,7 +54,7 @@ module ActionController # fresh_when(etag: @article, last_modified: @article.created_at, public: true) # end # - # This will render the show template if the request isn't sending a matching etag or + # This will render the show template if the request isn't sending a matching ETag or # If-Modified-Since header and just a 304 Not Modified response if there's a match. # # You can also just pass a record where +last_modified+ will be set by calling -- cgit v1.2.3 From 6c941ea40571acd1e399bf885605ea90c30e1807 Mon Sep 17 00:00:00 2001 From: Steven Harman Date: Tue, 16 Sep 2014 15:24:24 -0400 Subject: Consistently markup etag options. --- actionpack/lib/action_controller/metal/conditional_get.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/actionpack/lib/action_controller/metal/conditional_get.rb b/actionpack/lib/action_controller/metal/conditional_get.rb index f0e3e59282..b210ee3423 100644 --- a/actionpack/lib/action_controller/metal/conditional_get.rb +++ b/actionpack/lib/action_controller/metal/conditional_get.rb @@ -32,7 +32,7 @@ module ActionController end end - # Sets the etag, +last_modified+, or both on the response and renders a + # Sets the +etag+, +last_modified+, or both on the response and renders a # 304 Not Modified response if the request is already fresh. # # === Parameters: @@ -58,7 +58,7 @@ module ActionController # If-Modified-Since header and just a 304 Not Modified response if there's a match. # # You can also just pass a record where +last_modified+ will be set by calling - # +updated_at+ and the etag by passing the object itself. + # +updated_at+ and the +etag+ by passing the object itself. # # def show # @article = Article.find(params[:id]) @@ -124,7 +124,7 @@ module ActionController # end # # You can also just pass a record where +last_modified+ will be set by calling - # updated_at and the etag by passing the object itself. + # +updated_at+ and the +etag+ by passing the object itself. # # def show # @article = Article.find(params[:id]) -- cgit v1.2.3