From 72118ba01db23f83e2cb88d6f690e243e50c5145 Mon Sep 17 00:00:00 2001 From: Noam Gagliardi Date: Mon, 18 Feb 2013 04:45:58 -0500 Subject: clarify singular and plural routes Found the wording on line 158 somewhat confusing. Added short example to clarify. --- guides/source/routing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides') diff --git a/guides/source/routing.md b/guides/source/routing.md index 4614169653..8c8ac34862 100644 --- a/guides/source/routing.md +++ b/guides/source/routing.md @@ -155,7 +155,7 @@ creates six different routes in your application, all mapping to the `Geocoders` | PATCH/PUT | /geocoder | update | update the one and only geocoder resource | | DELETE | /geocoder | destroy | delete the geocoder resource | -NOTE: Because you might want to use the same controller for a singular route (`/account`) and a plural route (`/accounts/45`), singular resources map to plural controllers. +NOTE: Because you might want to use the same controller for a singular route (`/account`) and a plural route (`/accounts/45`), singular resources map to plural controllers. So that, for example, `resource :photo` and `resources :photos` creates both singular and plural routes that map to the same controller (`PhotosController`). A singular resourceful route generates these helpers: -- cgit v1.2.3 From 8743f800db529ef21a757b70230527fdae0691cc Mon Sep 17 00:00:00 2001 From: Hanfei Shen Date: Tue, 19 Feb 2013 00:41:09 +0800 Subject: Update guides/source/active_record_querying.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix missing `ORDER BY id ASC` for Client.first(2); UppercaseĀ the little y in the SQL equivalent of the Client.last(2). --- guides/source/active_record_querying.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'guides') diff --git a/guides/source/active_record_querying.md b/guides/source/active_record_querying.md index 62d6294ae5..226c1f1475 100644 --- a/guides/source/active_record_querying.md +++ b/guides/source/active_record_querying.md @@ -299,7 +299,7 @@ Client.first(2) The SQL equivalent of the above is: ```sql -SELECT * FROM clients LIMIT 2 +SELECT * FROM clients ORDER BY id ASC LIMIT 2 ``` #### last @@ -315,7 +315,7 @@ Client.last(2) The SQL equivalent of the above is: ```sql -SELECT * FROM clients ORDER By id DESC LIMIT 2 +SELECT * FROM clients ORDER BY id DESC LIMIT 2 ``` ### Retrieving Multiple Objects in Batches -- cgit v1.2.3 From f9f6fc7a91fecc7a52c812d2900b9ae5d4636743 Mon Sep 17 00:00:00 2001 From: Brian Kim Date: Mon, 18 Feb 2013 14:20:37 -0500 Subject: Fix bug in code example from layouts and rendering guide The code in 2.3.2 assumed that render has an alert option like redirect_to to create a flash alert message, but it doesn't. --- guides/source/layouts_and_rendering.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'guides') diff --git a/guides/source/layouts_and_rendering.md b/guides/source/layouts_and_rendering.md index 339008ab9e..bfd1a7c61b 100644 --- a/guides/source/layouts_and_rendering.md +++ b/guides/source/layouts_and_rendering.md @@ -568,7 +568,8 @@ def show @book = Book.find_by_id(params[:id]) if @book.nil? @books = Book.all - render "index", alert: "Your book was not found!" + flash[:alert] = "Your book was not found" + render "index" end end ``` -- cgit v1.2.3 From ac0285ecb874f7e6ded736f377182972e47e3330 Mon Sep 17 00:00:00 2001 From: Arne Brasseur Date: Wed, 20 Feb 2013 13:19:35 +0100 Subject: Update the "upgrading" guide for people coming from 3.0 and 3.1. The latest versions for 3.1 and 3.2 are now 3.2.12 and 3.1.11 respectively. --- guides/source/upgrading_ruby_on_rails.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'guides') diff --git a/guides/source/upgrading_ruby_on_rails.md b/guides/source/upgrading_ruby_on_rails.md index 568767d9de..15a6bb784d 100644 --- a/guides/source/upgrading_ruby_on_rails.md +++ b/guides/source/upgrading_ruby_on_rails.md @@ -97,14 +97,14 @@ Upgrading from Rails 3.1 to Rails 3.2 If your application is currently on any version of Rails older than 3.1.x, you should upgrade to Rails 3.1 before attempting an update to Rails 3.2. -The following changes are meant for upgrading your application to Rails 3.2.2, the latest 3.2.x version of Rails. +The following changes are meant for upgrading your application to Rails 3.2.12, the latest 3.2.x version of Rails. ### Gemfile Make the following changes to your `Gemfile`. ```ruby -gem 'rails', '= 3.2.2' +gem 'rails', '= 3.2.12' group :assets do gem 'sass-rails', '~> 3.2.3' @@ -144,14 +144,14 @@ Upgrading from Rails 3.0 to Rails 3.1 If your application is currently on any version of Rails older than 3.0.x, you should upgrade to Rails 3.0 before attempting an update to Rails 3.1. -The following changes are meant for upgrading your application to Rails 3.1.3, the latest 3.1.x version of Rails. +The following changes are meant for upgrading your application to Rails 3.1.11, the latest 3.1.x version of Rails. ### Gemfile Make the following changes to your `Gemfile`. ```ruby -gem 'rails', '= 3.1.3' +gem 'rails', '= 3.1.11' gem 'mysql2' # Needed for the new asset pipeline -- cgit v1.2.3 From 7ded3b8c4bb24e02a93ced0dc78879c3210b526c Mon Sep 17 00:00:00 2001 From: bobbus Date: Fri, 22 Feb 2013 00:24:35 +0100 Subject: Link is not relevant anymore Cannot find the screencast on the internet, guess it was removed --- guides/source/caching_with_rails.md | 5 ----- 1 file changed, 5 deletions(-) (limited to 'guides') diff --git a/guides/source/caching_with_rails.md b/guides/source/caching_with_rails.md index a270ec7a7e..abab3dd983 100644 --- a/guides/source/caching_with_rails.md +++ b/guides/source/caching_with_rails.md @@ -343,8 +343,3 @@ class ProductsController < ApplicationController end end ``` - -Further reading ---------------- - -* [Scaling Rails Screencasts](http://railslab.newrelic.com/scaling-rails) -- cgit v1.2.3 From f7a0a95de2daa4f8e68e0b1687f1d77df70d7778 Mon Sep 17 00:00:00 2001 From: Gagan Awhad Date: Fri, 22 Feb 2013 10:10:42 -0600 Subject: Added documentation for beginning_of_minute and end_of_minute to Active Support Core Extensions guide --- guides/source/active_support_core_extensions.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'guides') diff --git a/guides/source/active_support_core_extensions.md b/guides/source/active_support_core_extensions.md index f02b377832..517db0d222 100644 --- a/guides/source/active_support_core_extensions.md +++ b/guides/source/active_support_core_extensions.md @@ -3320,7 +3320,25 @@ date.end_of_hour # => Mon Jun 07 19:59:59 +0200 2010 `beginning_of_hour` is aliased to `at_beginning_of_hour`. -INFO: `beginning_of_hour` and `end_of_hour` are implemented for `Time` and `DateTime` but **not** `Date` as it does not make sense to request the beginning or end of an hour on a `Date` instance. +##### `beginning_of_minute`, `end_of_minute` + +The method `beginning_of_minute` returns a timestamp at the beginning of the minute (hh:mm:00): + +```ruby +date = DateTime.new(2010, 6, 7, 19, 55, 25) +date.beginning_of_minute # => Mon Jun 07 19:55:00 +0200 2010 +``` + +The method `end_of_minute` returns a timestamp at the end of the minute (hh:mm:59): + +```ruby +date = DateTime.new(2010, 6, 7, 19, 55, 25) +date.end_of_minute # => Mon Jun 07 19:55:59 +0200 2010 +``` + +`beginning_of_minute` is aliased to `at_beginning_of_minute`. + +INFO: `beginning_of_hour`, `end_of_hour`, `beginning_of_minute` and `end_of_minute` are implemented for `Time` and `DateTime` but **not** `Date` as it does not make sense to request the beginning or end of an hour or minute on a `Date` instance. ##### `ago`, `since` -- cgit v1.2.3 From a1dd468b1cdcae5efcf931d219d2ac03ae8f47e7 Mon Sep 17 00:00:00 2001 From: Qihuan Piao Date: Mon, 25 Feb 2013 00:29:03 +0900 Subject: Wrap `around_action` word with tag --- guides/source/action_mailer_basics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides') diff --git a/guides/source/action_mailer_basics.md b/guides/source/action_mailer_basics.md index 513ae1272f..562ab73bec 100644 --- a/guides/source/action_mailer_basics.md +++ b/guides/source/action_mailer_basics.md @@ -447,7 +447,7 @@ end Action Mailer Callbacks --------------------------- -Action Mailer allows for you to specify a `before_action`, `after_action` and 'around_action'. +Action Mailer allows for you to specify a `before_action`, `after_action` and `around_action`. * Filters can be specified with a block or a symbol to a method in the mailer class similar to controllers. -- cgit v1.2.3 From 5d631475a19613711530b199ab5a15066f6349ac Mon Sep 17 00:00:00 2001 From: Qihuan Piao Date: Mon, 25 Feb 2013 00:38:46 +0900 Subject: Update guide doc to use migration shortcuts --- guides/source/action_mailer_basics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides') diff --git a/guides/source/action_mailer_basics.md b/guides/source/action_mailer_basics.md index 562ab73bec..a5058aa749 100644 --- a/guides/source/action_mailer_basics.md +++ b/guides/source/action_mailer_basics.md @@ -116,7 +116,7 @@ Setting this up is painfully simple. First off, we need to create a simple `User` scaffold: ```bash -$ rails generate scaffold user name:string email:string login:string +$ rails generate scaffold user name email login $ rake db:migrate ``` -- cgit v1.2.3