Skip to content

Commit ed78770

Browse files
committed
Remove references to Rails versions.
There's no reason for guides to reference old behaviors. They should be current as of the versions of Rails that they ship with, and including older information just clutters thing. I discussed this change with @fxn and he agrees.
1 parent e618adb commit ed78770

13 files changed

+15
-59
lines changed

guides/source/action_controller_overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ NOTE: Certain exceptions are only rescuable from the `ApplicationController` cla
828828
Force HTTPS protocol
829829
--------------------
830830

831-
Sometime you might want to force a particular controller to only be accessible via an HTTPS protocol for security reasons. Since Rails 3.1 you can now use the `force_ssl` method in your controller to enforce that:
831+
Sometime you might want to force a particular controller to only be accessible via an HTTPS protocol for security reasons. You can use the `force_ssl` method in your controller to enforce that:
832832

833833
```ruby
834834
class DinnerController

guides/source/action_mailer_basics.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ When you call the `mail` method now, Action Mailer will detect the two templates
109109

110110
#### Wire It Up So That the System Sends the Email When a User Signs Up
111111

112-
There are several ways to do this, some people create Rails Observers to fire off emails, others do it inside of the User Model. However, in Rails 3, mailers are really just another way to render a view. Instead of rendering a view and sending out the HTTP protocol, they are just sending it out through the Email protocols instead. Due to this, it makes sense to just have your controller tell the mailer to send an email when a user is successfully created.
112+
There are several ways to do this, some people create Rails Observers to fire off emails, others do it inside of the User Model. However, mailers are really just another way to render a view. Instead of rendering a view and sending out the HTTP protocol, they are just sending it out through the Email protocols instead. Due to this, it makes sense to just have your controller tell the mailer to send an email when a user is successfully created.
113113

114114
Setting this up is painfully simple.
115115

@@ -149,8 +149,6 @@ This provides a much simpler implementation that does not require the registerin
149149

150150
The method `welcome_email` returns a `Mail::Message` object which can then just be told `deliver` to send itself out.
151151

152-
NOTE: In previous versions of Rails, you would call `deliver_welcome_email` or `create_welcome_email`. This has been deprecated in Rails 3.0 in favour of just calling the method name itself.
153-
154152
WARNING: Sending out an email should only take a fraction of a second. If you are planning on sending out many emails, or you have a slow domain resolution service, you might want to investigate using a background process like Delayed Job.
155153

156154
### Auto encoding header values

guides/source/action_view_overview.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,10 +1263,8 @@ Creates a field set for grouping HTML form elements.
12631263

12641264
Creates a file upload field.
12651265

1266-
Prior to Rails 3.1, if you are using file uploads, then you will need to set the multipart option for the form tag. Rails 3.1+ does this automatically.
1267-
12681266
```html+erb
1269-
<%= form_tag {action: "post"}, {multipart: true} do %>
1267+
<%= form_tag {action: "post"} do %>
12701268
<label for="file">File to Upload</label> <%= file_field_tag "file" %>
12711269
<%= submit_tag %>
12721270
<% end %>

guides/source/active_record_querying.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,8 +1222,6 @@ You can specify an exclamation point (`!`) on the end of the dynamic finders to
12221222

12231223
If you want to find both by name and locked, you can chain these finders together by simply typing "`and`" between the fields. For example, `Client.find_by_first_name_and_locked("Ryan", true)`.
12241224

1225-
WARNING: Up to and including Rails 3.1, when the number of arguments passed to a dynamic finder method is lesser than the number of fields, say `Client.find_by_name_and_locked("Ryan")`, the behavior is to pass `nil` as the missing argument. This is **unintentional** and this behavior has been changed in Rails 3.2 to throw an `ArgumentError`.
1226-
12271225
Find or Build a New Object
12281226
--------------------------
12291227

guides/source/active_support_core_extensions.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,8 +1120,6 @@ C.subclasses # => [B, D]
11201120

11211121
The order in which these classes are returned is unspecified.
11221122

1123-
WARNING: This method is redefined in some Rails core classes but should be all compatible in Rails 3.1.
1124-
11251123
NOTE: Defined in `active_support/core_ext/class/subclasses.rb`.
11261124

11271125
#### `descendants`
@@ -1157,7 +1155,7 @@ Inserting data into HTML templates needs extra care. For example, you can't just
11571155

11581156
#### Safe Strings
11591157

1160-
Active Support has the concept of <i>(html) safe</i> strings since Rails 3. A safe string is one that is marked as being insertable into HTML as is. It is trusted, no matter whether it has been escaped or not.
1158+
Active Support has the concept of <i>(html) safe</i> strings. A safe string is one that is marked as being insertable into HTML as is. It is trusted, no matter whether it has been escaped or not.
11611159

11621160
Strings are considered to be <i>unsafe</i> by default:
11631161

@@ -1194,10 +1192,10 @@ Safe arguments are directly appended:
11941192
"".html_safe + "<".html_safe # => "<"
11951193
```
11961194

1197-
These methods should not be used in ordinary views. In Rails 3 unsafe values are automatically escaped:
1195+
These methods should not be used in ordinary views. Unsafe values are automatically escaped:
11981196

11991197
```erb
1200-
<%= @review.title %> <%# fine in Rails 3, escaped if needed %>
1198+
<%= @review.title %> <%# fine, escaped if needed %>
12011199
```
12021200

12031201
To insert something verbatim use the `raw` helper rather than calling `html_safe`:

guides/source/asset_pipeline.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
The Asset Pipeline
22
==================
33

4-
This guide covers the asset pipeline introduced in Rails 3.1.
4+
This guide covers the asset pipeline.
55

66
After reading this guide, you will know:
77

@@ -18,11 +18,9 @@ What is the Asset Pipeline?
1818

1919
The asset pipeline provides a framework to concatenate and minify or compress JavaScript and CSS assets. It also adds the ability to write these assets in other languages such as CoffeeScript, Sass and ERB.
2020

21-
Prior to Rails 3.1 these features were added through third-party Ruby libraries such as Jammit and Sprockets. Rails 3.1 is integrated with Sprockets through Action Pack which depends on the `sprockets` gem, by default.
22-
2321
Making the asset pipeline a core feature of Rails means that all developers can benefit from the power of having their assets pre-processed, compressed and minified by one central library, Sprockets. This is part of Rails' "fast by default" strategy as outlined by DHH in his keynote at RailsConf 2011.
2422

25-
In Rails 3.1, the asset pipeline is enabled by default. It can be disabled in `config/application.rb` by putting this line inside the application class definition:
23+
The asset pipeline is enabled by default. It can be disabled in `config/application.rb` by putting this line inside the application class definition:
2624

2725
```ruby
2826
config.assets.enabled = false
@@ -287,8 +285,6 @@ For example, a new Rails application includes a default `app/assets/javascripts/
287285

288286
In JavaScript files, the directives begin with `//=`. In this case, the file is using the `require` and the `require_tree` directives. The `require` directive is used to tell Sprockets the files that you wish to require. Here, you are requiring the files `jquery.js` and `jquery_ujs.js` that are available somewhere in the search path for Sprockets. You need not supply the extensions explicitly. Sprockets assumes you are requiring a `.js` file when done from within a `.js` file.
289287

290-
NOTE. In Rails 3.1 the `jquery-rails` gem provides the `jquery.js` and `jquery_ujs.js` files via the asset pipeline. You won't see them in the application tree.
291-
292288
The `require_tree` directive tells Sprockets to recursively include _all_ JavaScript files in the specified directory into the output. These paths must be specified relative to the manifest file. You can also use the `require_directory` directive which includes all JavaScript files only in the directory specified, without recursion.
293289

294290
Directives are processed top to bottom, but the order in which files are included by `require_tree` is unspecified. You should not rely on any particular order among those. If you need to ensure some particular JavaScript ends up above some other in the concatenated file, require the prerequisite file first in the manifest. Note that the family of `require` directives prevents files from being included twice in the output.
@@ -665,7 +661,7 @@ This can be changed to something else:
665661
config.assets.prefix = "/some_other_path"
666662
```
667663

668-
This is a handy option if you are updating an existing project (pre Rails 3.1) that already uses this path or you wish to use this path for a new resource.
664+
This is a handy option if you are updating an older project that didn't use the asset pipeline and that already uses this path or you wish to use this path for a new resource.
669665

670666
### X-Sendfile Headers
671667

guides/source/configuring.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,6 @@ These configuration methods are to be called on a `Rails::Railtie` object, such
135135
136136
### Configuring Assets
137137
138-
Rails 3.1 and up, by default, is set up to use the `sprockets` gem to manage assets within an application. This gem concatenates and compresses assets in order to make serving them much less painful.
139-
140138
* `config.assets.enabled` a flag that controls whether the asset pipeline is enabled. It is explicitly initialized in `config/application.rb`.
141139
142140
* `config.assets.compress` a flag that enables the compression of compiled assets. It is explicitly set to true in `config/production.rb`.
@@ -165,7 +163,7 @@ Rails 3.1 and up, by default, is set up to use the `sprockets` gem to manage ass
165163
166164
### Configuring Generators
167165
168-
Rails 3 allows you to alter what generators are used with the `config.generators` method. This method takes a block:
166+
Rails allows you to alter what generators are used with the `config.generators` method. This method takes a block:
169167
170168
```ruby
171169
config.generators do |g|

guides/source/engines.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Finally, engines would not have been possible without the work of James Adam, Pi
3535
Generating an engine
3636
--------------------
3737

38-
To generate an engine with Rails 3.2, you will need to run the plugin generator and pass it options as appropriate to the need. For the "blorgh" example, you will need to create a "mountable" engine, running this command in a terminal:
38+
To generate an engine, you will need to run the plugin generator and pass it options as appropriate to the need. For the "blorgh" example, you will need to create a "mountable" engine, running this command in a terminal:
3939

4040
```bash
4141
$ rails plugin new blorgh --mountable

guides/source/form_helpers.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,8 +594,6 @@ The following two forms both upload a file.
594594
<% end %>
595595
```
596596

597-
NOTE: Since Rails 3.1, forms rendered using `form_for` have their encoding set to `multipart/form-data` automatically once a `file_field` is used inside the block. Previous versions required you to set this explicitly.
598-
599597
Rails provides the usual pair of helpers: the barebones `file_field_tag` and the model oriented `file_field`. The only difference with other helpers is that you cannot set a default value for file inputs as this would have no meaning. As you would expect in the first case the uploaded file is in `params[:picture]` and in the second case in `params[:person][:picture]`.
600598

601599
### What Gets Uploaded

guides/source/generators.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ After reading this guide, you will know:
1515

1616
--------------------------------------------------------------------------------
1717

18-
NOTE: This guide is about generators in Rails 3, previous versions are not covered.
19-
2018
First Contact
2119
-------------
2220

guides/source/layouts_and_rendering.md

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -160,21 +160,6 @@ def update
160160
end
161161
```
162162

163-
To be explicit, you can use `render` with the `:action` option (though this is no longer necessary in Rails 3.0):
164-
165-
```ruby
166-
def update
167-
@book = Book.find(params[:id])
168-
if @book.update_attributes(params[:book])
169-
redirect_to(@book)
170-
else
171-
render action: "edit"
172-
end
173-
end
174-
```
175-
176-
WARNING: Using `render` with `:action` is a frequent source of confusion for Rails newcomers. The specified action is used to determine which view to render, but Rails does _not_ run any of the code for that action in the controller. Any instance variables that you require in the view must be set up in the current action before calling `render`.
177-
178163
#### Rendering an Action's Template from Another Controller
179164

180165
What if you want to render a template from an entirely different controller from the one that contains the action code? You can also do that with `render`, which accepts the full path (relative to `app/views`) of the template to render. For example, if you're running code in an `AdminProductsController` that lives in `app/controllers/admin`, you can render the results of an action to a template in `app/views/products` this way:
@@ -674,7 +659,7 @@ There are three tag options available for the `auto_discovery_link_tag`:
674659

675660
The `javascript_include_tag` helper returns an HTML `script` tag for each source provided.
676661

677-
If you are using Rails with the [Asset Pipeline](asset_pipeline.html) enabled, this helper will generate a link to `/assets/javascripts/` rather than `public/javascripts` which was used in earlier versions of Rails. This link is then served by the Sprockets gem, which was introduced in Rails 3.1.
662+
If you are using Rails with the [Asset Pipeline](asset_pipeline.html) enabled, this helper will generate a link to `/assets/javascripts/` rather than `public/javascripts` which was used in earlier versions of Rails. This link is then served by the asset pipeline.
678663

679664
A JavaScript file within a Rails application or Rails engine goes in one of three locations: `app/assets`, `lib/assets` or `vendor/assets`. These locations are explained in detail in the [Asset Organization section in the Asset Pipeline Guide](asset_pipeline.html#asset-organization)
680665

@@ -843,7 +828,7 @@ You can even use dynamic paths such as `cache/#{current_site}/main/display`.
843828

844829
The `image_tag` helper builds an HTML `<img />` tag to the specified file. By default, files are loaded from `public/images`.
845830

846-
WARNING: Note that you must specify the extension of the image. Previous versions of Rails would allow you to just use the image name and would append `.png` if no extension was given but Rails 3.0 does not.
831+
WARNING: Note that you must specify the extension of the image.
847832

848833
```erb
849834
<%= image_tag "header.png" %>
@@ -1091,8 +1076,6 @@ Every partial also has a local variable with the same name as the partial (minus
10911076

10921077
Within the `customer` partial, the `customer` variable will refer to `@new_customer` from the parent view.
10931078

1094-
WARNING: In previous versions of Rails, the default local variable would look for an instance variable with the same name as the partial in the parent. This behavior was deprecated in 2.3 and has been removed in Rails 3.0.
1095-
10961079
If you have an instance of a model to render into a partial, you can use a shorthand syntax:
10971080

10981081
```erb
@@ -1120,7 +1103,7 @@ Partials are very useful in rendering collections. When you pass a collection to
11201103
11211104
When a partial is called with a pluralized collection, then the individual instances of the partial have access to the member of the collection being rendered via a variable named after the partial. In this case, the partial is `_product`, and within the `_product` partial, you can refer to `product` to get the instance that is being rendered.
11221105
1123-
In Rails 3.0, there is also a shorthand for this. Assuming `@products` is a collection of `product` instances, you can simply write this in the `index.html.erb` to produce the same result:
1106+
There is also a shorthand for this. Assuming `@products` is a collection of `product` instances, you can simply write this in the `index.html.erb` to produce the same result:
11241107
11251108
```html+erb
11261109
<h1>Products</h1>

guides/source/plugins.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,13 @@ goodness.
2727
Setup
2828
-----
2929

30-
_"vendored plugins"_ were available in previous versions of Rails, but they are deprecated in
31-
Rails 3.2, and will not be available in the future.
32-
3330
Currently, Rails plugins are built as gems, _gemified plugins_. They can be shared across
3431
different rails applications using RubyGems and Bundler if desired.
3532

3633
### Generate a gemified plugin.
3734

3835

39-
Rails 3.1 ships with a `rails plugin new` command which creates a
36+
Rails ships with a `rails plugin new` command which creates a
4037
skeleton for developing any kind of Rails extension with the ability
4138
to run integration tests using a dummy Rails application. See usage
4239
and options by asking for help:

guides/source/routing.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -733,12 +733,6 @@ get '*a/foo/*b', to: 'test#index'
733733

734734
would match `zoo/woo/foo/bar/baz` with `params[:a]` equals `'zoo/woo'`, and `params[:b]` equals `'bar/baz'`.
735735

736-
NOTE: Starting from Rails 3.1, wildcard segments will always match the optional format segment by default. For example if you have this route:
737-
738-
```ruby
739-
get '*pages', to: 'pages#show'
740-
```
741-
742736
NOTE: By requesting `'/foo/bar.json'`, your `params[:pages]` will be equals to `'foo/bar'` with the request format of JSON. If you want the old 3.0.x behavior back, you could supply `format: false` like this:
743737

744738
```ruby

0 commit comments

Comments
 (0)