diff options
Diffstat (limited to 'guides')
-rw-r--r-- | guides/CHANGELOG.md | 3 | ||||
-rw-r--r-- | guides/source/action_mailer_basics.md | 4 | ||||
-rw-r--r-- | guides/source/active_record_querying.md | 4 | ||||
-rw-r--r-- | guides/source/active_support_core_extensions.md | 20 | ||||
-rw-r--r-- | guides/source/caching_with_rails.md | 5 | ||||
-rw-r--r-- | guides/source/layouts_and_rendering.md | 3 | ||||
-rw-r--r-- | guides/source/routing.md | 2 | ||||
-rw-r--r-- | guides/source/upgrading_ruby_on_rails.md | 8 |
8 files changed, 33 insertions, 16 deletions
diff --git a/guides/CHANGELOG.md b/guides/CHANGELOG.md index a9595d1f15..ee6e64b731 100644 --- a/guides/CHANGELOG.md +++ b/guides/CHANGELOG.md @@ -1,3 +1,6 @@ +## Rails 4.0.0 (unreleased) ## + + ## Rails 4.0.0.beta1 (unreleased) ## * Split Validations and Callbacks guide into two. *Steve Klabnik* diff --git a/guides/source/action_mailer_basics.md b/guides/source/action_mailer_basics.md index 513ae1272f..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 ``` @@ -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. diff --git a/guides/source/active_record_querying.md b/guides/source/active_record_querying.md index bc3b1669d2..5d82541da9 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 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` 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) 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 ``` 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: diff --git a/guides/source/upgrading_ruby_on_rails.md b/guides/source/upgrading_ruby_on_rails.md index f5d7f1bfe2..52f5232efc 100644 --- a/guides/source/upgrading_ruby_on_rails.md +++ b/guides/source/upgrading_ruby_on_rails.md @@ -114,14 +114,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' @@ -161,14 +161,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 |