rails 4.0.0.beta1 → 4.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rails might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +78 -0
- data/guides/CHANGELOG.md +3 -0
- data/guides/assets/images/getting_started/unknown_action_create_for_posts.png +0 -0
- data/guides/bug_report_templates/active_record_gem.rb +37 -0
- data/guides/bug_report_templates/active_record_master.rb +48 -0
- data/guides/code/getting_started/Gemfile +16 -11
- data/guides/code/getting_started/app/controllers/comments_controller.rb +2 -2
- data/guides/code/getting_started/app/controllers/posts_controller.rb +2 -2
- data/guides/code/getting_started/config/application.rb +3 -2
- data/guides/code/getting_started/config/initializers/session_store.rb +1 -1
- data/guides/code/getting_started/config/routes.rb +2 -2
- data/guides/code/getting_started/public/404.html +41 -10
- data/guides/code/getting_started/public/422.html +42 -10
- data/guides/code/getting_started/public/500.html +41 -10
- data/guides/rails_guides/markdown/renderer.rb +1 -1
- data/guides/source/2_2_release_notes.md +15 -15
- data/guides/source/4_0_release_notes.md +1 -7
- data/guides/source/action_controller_overview.md +176 -22
- data/guides/source/action_mailer_basics.md +246 -141
- data/guides/source/action_view_overview.md +3 -8
- data/guides/source/active_record_basics.md +98 -95
- data/guides/source/active_record_querying.md +90 -17
- data/guides/source/active_record_validations.md +41 -0
- data/guides/source/active_support_core_extensions.md +23 -3
- data/guides/source/active_support_instrumentation.md +6 -6
- data/guides/source/asset_pipeline.md +1 -1
- data/guides/source/association_basics.md +34 -10
- data/guides/source/caching_with_rails.md +2 -7
- data/guides/source/command_line.md +7 -7
- data/guides/source/configuring.md +3 -3
- data/guides/source/contributing_to_ruby_on_rails.md +38 -5
- data/guides/source/credits.html.erb +1 -1
- data/guides/source/debugging_rails_applications.md +19 -22
- data/guides/source/development_dependencies_install.md +2 -2
- data/guides/source/documents.yaml +5 -1
- data/guides/source/engines.md +21 -16
- data/guides/source/form_helpers.md +28 -7
- data/guides/source/generators.md +2 -2
- data/guides/source/getting_started.md +14 -13
- data/guides/source/i18n.md +22 -0
- data/guides/source/initialization.md +1 -1
- data/guides/source/layouts_and_rendering.md +60 -4
- data/guides/source/migrations.md +27 -2
- data/guides/source/rails_application_templates.md +11 -11
- data/guides/source/rails_on_rack.md +9 -6
- data/guides/source/routing.md +19 -3
- data/guides/source/ruby_on_rails_guides_guidelines.md +1 -1
- data/guides/source/security.md +2 -2
- data/guides/source/testing.md +106 -85
- data/guides/source/upgrading_ruby_on_rails.md +112 -9
- data/guides/source/working_with_javascript_in_rails.md +1 -0
- metadata +17 -16
- data/README.rdoc +0 -77
- data/guides/code/getting_started/app/assets/images/rails.png +0 -0
@@ -31,6 +31,10 @@ If your application is currently on any version of Rails older than 3.2.x, you s
|
|
31
31
|
|
32
32
|
The following changes are meant for upgrading your application to Rails 4.0.
|
33
33
|
|
34
|
+
### Gemfile
|
35
|
+
|
36
|
+
Rails 4.0 removed the `assets` group from Gemfile. You'd need to remove that line from your Gemfile when upgrading.
|
37
|
+
|
34
38
|
### vendor/plugins
|
35
39
|
|
36
40
|
Rails 4.0 no longer supports loading plugins from `vendor/plugins`. You must replace any plugins by extracting them to gems and adding them to your Gemfile. If you choose not to make them gems, you can move them into, say, `lib/my_plugin/*` and add an appropriate initializer in `config/initializers/my_plugin.rb`.
|
@@ -43,17 +47,29 @@ Rails 4.0 no longer supports loading plugins from `vendor/plugins`. You must rep
|
|
43
47
|
|
44
48
|
* Rails 4.0 has changed how orders get stacked in `ActiveRecord::Relation`. In previous versions of Rails, the new order was applied after the previously defined order. But this is no longer true. Check [Active Record Query guide](active_record_querying.html#ordering) for more information.
|
45
49
|
|
46
|
-
* Rails 4.0 has changed `serialized_attributes` and `attr_readonly` to class methods only.
|
50
|
+
* Rails 4.0 has changed `serialized_attributes` and `attr_readonly` to class methods only. You shouldn't use instance methods since it's now deprecated. You should change them to use class methods, e.g. `self.serialized_attributes` to `self.class.serialized_attributes`.
|
47
51
|
|
48
52
|
* Rails 4.0 has removed `attr_accessible` and `attr_protected` feature in favor of Strong Parameters. You can use the [Protected Attributes gem](https://github.com/rails/protected_attributes) to a smoothly upgrade path.
|
49
53
|
|
54
|
+
* Rails 4.0 requires that scopes use a callable object such as a Proc or lambda:
|
55
|
+
|
56
|
+
```ruby
|
57
|
+
scope :active, where(active: true)
|
58
|
+
|
59
|
+
# becomes
|
60
|
+
scope :active, -> { where active: true }
|
61
|
+
```
|
62
|
+
|
63
|
+
* Rails 4.0 has deprecated `ActiveRecord::Fixtures` in favor of `ActiveRecord::FixtureSet`.
|
64
|
+
* Rails 4.0 has deprecated `ActiveRecord::TestCase` in favor of `ActiveSupport::TestCase`.
|
65
|
+
|
50
66
|
### Active Resource
|
51
67
|
|
52
|
-
Rails 4.0 extracted Active Resource to its
|
68
|
+
Rails 4.0 extracted Active Resource to its own gem. If you still need the feature you can add the [Active Resource gem](https://github.com/rails/activeresource) in your Gemfile.
|
53
69
|
|
54
70
|
### Active Model
|
55
71
|
|
56
|
-
* Rails 4.0 has changed how errors attach with the `ActiveModel::Validations::ConfirmationValidator`. Now when confirmation validations fail the error will be attached to `:#{attribute}_confirmation` instead of `attribute`.
|
72
|
+
* Rails 4.0 has changed how errors attach with the `ActiveModel::Validations::ConfirmationValidator`. Now when confirmation validations fail, the error will be attached to `:#{attribute}_confirmation` instead of `attribute`.
|
57
73
|
|
58
74
|
* Rails 4.0 has changed `ActiveModel::Serializers::JSON.include_root_in_json` default value to `false`. Now, Active Model Serializers and Active Record objects have the same default behaviour. This means that you can comment or remove the following option in the `config/initializers/wrap_parameters.rb` file:
|
59
75
|
|
@@ -66,7 +82,31 @@ Rails 4.0 extracted Active Resource to its our gem. If you still need the featur
|
|
66
82
|
|
67
83
|
### Action Pack
|
68
84
|
|
69
|
-
*
|
85
|
+
* Rails 4.0 introduces `ActiveSupport::KeyGenerator` and uses this as a base from which to generate and verify signed cookies (among other things). Existing signed cookies generated with Rails 3.x will be transparently upgraded if you leave your existing `secret_token` in place and add the new `secret_key_base`.
|
86
|
+
|
87
|
+
```ruby
|
88
|
+
# config/initializers/secret_token.rb
|
89
|
+
Myapp::Application.config.secret_token = 'existing secret token'
|
90
|
+
Myapp::Application.config.secret_key_base = 'new secret key base'
|
91
|
+
```
|
92
|
+
|
93
|
+
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.
|
94
|
+
|
95
|
+
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.
|
96
|
+
|
97
|
+
* 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.
|
98
|
+
|
99
|
+
As described above, existing signed cookies generated with Rails 3.x will be transparently upgraded if you leave your existing `secret_token` in place and add the new `secret_key_base`.
|
100
|
+
|
101
|
+
```ruby
|
102
|
+
# config/initializers/secret_token.rb
|
103
|
+
Myapp::Application.config.secret_token = 'existing secret token'
|
104
|
+
Myapp::Application.config.secret_key_base = 'new secret key base'
|
105
|
+
```
|
106
|
+
|
107
|
+
The same caveats apply here, too. 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. You should also take care to make sure you are not relying on the ability to decode signed cookies generated by your app in external applications or Javascript before upgrading.
|
108
|
+
|
109
|
+
Please read [Pull Request #9978](https://github.com/rails/rails/pull/9978) for details on the move to encrypted session cookies.
|
70
110
|
|
71
111
|
* Rails 4.0 removed the `ActionController::Base.asset_path` option. Use the assets pipeline feature.
|
72
112
|
|
@@ -74,8 +114,31 @@ Rails 4.0 extracted Active Resource to its our gem. If you still need the featur
|
|
74
114
|
|
75
115
|
* Rails 4.0 has removed Action and Page caching from Action Pack. You will need to add the `actionpack-action_caching` gem in order to use `caches_action` and the `actionpack-page_caching` to use `caches_pages` in your controllers.
|
76
116
|
|
117
|
+
* Rails 4.0 has removed the XML parameters parser. You will need to add the `actionpack-xml_parser` gem if you require this feature.
|
118
|
+
|
119
|
+
* Rails 4.0 changes the default memcached client from `memcache-client` to `dalli`. To upgrade, simply add `gem 'dalli'` to your `Gemfile`.
|
120
|
+
|
121
|
+
* Rails 4.0 deprecates the `dom_id` and `dom_class` methods. You will need to include the `ActionView::RecordIdentifier` module in controllers requiring this feature.
|
122
|
+
|
77
123
|
* Rails 4.0 changed how `assert_generates`, `assert_recognizes`, and `assert_routing` work. Now all these assertions raise `Assertion` instead of `ActionController::RoutingError`.
|
78
124
|
|
125
|
+
* Rails 4.0 raises an `ArgumentError` if clashing named routes are defined. This can be triggered by explicitly defined named routes or by the `resources` method. Here are two examples that clash with routes named `example_path`:
|
126
|
+
|
127
|
+
```ruby
|
128
|
+
get 'one' => 'test#example', as: :example
|
129
|
+
get 'two' => 'test#example', as: :example
|
130
|
+
```
|
131
|
+
|
132
|
+
```ruby
|
133
|
+
resources :examples
|
134
|
+
get 'clashing/:id' => 'test#example', as: :example
|
135
|
+
```
|
136
|
+
|
137
|
+
In the first case, you can simply avoid using the same name for multiple
|
138
|
+
routes. In the second, you can use the `only` or `except` options provided by
|
139
|
+
the `resources` method to restrict the routes created as detailed in the
|
140
|
+
[Routing Guide](routing.html#restricting-the-routes-created).
|
141
|
+
|
79
142
|
* Rails 4.0 also changed the way unicode character routes are drawn. Now you can draw unicode character routes directly. If you already draw such routes, you must change them, for example:
|
80
143
|
|
81
144
|
```ruby
|
@@ -88,7 +151,20 @@ becomes
|
|
88
151
|
get 'こんにちは', controller: 'welcome', action: 'index'
|
89
152
|
```
|
90
153
|
|
91
|
-
* Rails 4.0
|
154
|
+
* Rails 4.0 requires that routes using `match` must specify the request method. For example:
|
155
|
+
|
156
|
+
```ruby
|
157
|
+
# Rails 3.x
|
158
|
+
match "/" => "root#index"
|
159
|
+
|
160
|
+
# becomes
|
161
|
+
match "/" => "root#index", via: :get
|
162
|
+
|
163
|
+
# or
|
164
|
+
get "/" => "root#index"
|
165
|
+
```
|
166
|
+
|
167
|
+
* Rails 4.0 has removed `ActionDispatch::BestStandardsSupport` middleware, `<!DOCTYPE html>` already triggers standards mode per http://msdn.microsoft.com/en-us/library/jj676915(v=vs.85).aspx and ChromeFrame header has been moved to `config.action_dispatch.default_headers`.
|
92
168
|
|
93
169
|
Remember you must also remove any references to the middleware from your application code, for example:
|
94
170
|
|
@@ -101,6 +177,21 @@ Also check your environment settings for `config.action_dispatch.best_standards_
|
|
101
177
|
|
102
178
|
* In Rails 4.0, precompiling assets no longer automatically copies non-JS/CSS assets from `vendor/assets` and `lib/assets`. Rails application and engine developers should put these assets in `app/assets` or configure `config.assets.precompile`.
|
103
179
|
|
180
|
+
* In Rails 4.0, `ActionController::UnknownFormat` is raised when the action doesn't handle the request format. By default, the exception is handled by responding with 406 Not Acceptable, but you can override that now. In Rails 3, 406 Not Acceptable was always returned. No overrides.
|
181
|
+
|
182
|
+
* In Rails 4.0, a generic `ActionDispatch::ParamsParser::ParseError` exception is raised when `ParamsParser` fails to parse request params. You will want to rescue this exception instead of the low-level `MultiJson::DecodeError`, for example.
|
183
|
+
|
184
|
+
* In Rails 4.0, `SCRIPT_NAME` is properly nested when engines are mounted on an app that's served from a URL prefix. You no longer have to set `default_url_options[:script_name]` to work around overwritten URL prefixes.
|
185
|
+
|
186
|
+
* Rails 4.0 deprecated `ActionController::Integration` in favor of `ActionDispatch::Integration`.
|
187
|
+
* Rails 4.0 deprecated `ActionController::IntegrationTest` in favor of `ActionDispatch::IntegrationTest`.
|
188
|
+
* Rails 4.0 deprecated `ActionController::PerformanceTest` in favor of `ActionDispatch::PerformanceTest`.
|
189
|
+
* Rails 4.0 deprecated `ActionController::AbstractRequest` in favor of `ActionDispatch::Request`.
|
190
|
+
* Rails 4.0 deprecated `ActionController::Request` in favor of `ActionDispatch::Request`.
|
191
|
+
* Rails 4.0 deprecated `ActionController::AbstractResponse` in favor of `ActionDispatch::Response`.
|
192
|
+
* Rails 4.0 deprecated `ActionController::Response` in favor of `ActionDispatch::Response`.
|
193
|
+
* Rails 4.0 deprecated `ActionController::Routing` in favor of `ActionDispatch::Routing`.
|
194
|
+
|
104
195
|
### Active Support
|
105
196
|
|
106
197
|
Rails 4.0 removes the `j` alias for `ERB::Util#json_escape` since `j` is already used for `ActionView::Helpers::JavaScriptHelper#escape_javascript`.
|
@@ -109,19 +200,31 @@ Rails 4.0 removes the `j` alias for `ERB::Util#json_escape` since `j` is already
|
|
109
200
|
|
110
201
|
The order in which helpers from more than one directory are loaded has changed in Rails 4.0. Previously, they were gathered and then sorted alphabetically. After upgrading to Rails 4.0, helpers will preserve the order of loaded directories and will be sorted alphabetically only within each directory. Unless you explicitly use the `helpers_path` parameter, this change will only impact the way of loading helpers from engines. If you rely on the ordering, you should check if correct methods are available after upgrade. If you would like to change the order in which engines are loaded, you can use `config.railties_order=` method.
|
111
202
|
|
203
|
+
### Active Record Observer and Action Controller Sweeper
|
204
|
+
|
205
|
+
Active Record Observer and Action Controller Sweeper have been extracted to the `rails-observers` gem. You will need to add the `rails-observers` gem if you require these features.
|
206
|
+
|
207
|
+
### sprockets-rails
|
208
|
+
|
209
|
+
* `assets:precompile:primary` has been removed. Use `assets:precompile` instead.
|
210
|
+
|
211
|
+
### sass-rails
|
212
|
+
|
213
|
+
* `asset_url` with two arguments is deprecated. For example: `asset-url("rails.png", image)` becomes `asset-url("rails.png")`
|
214
|
+
|
112
215
|
Upgrading from Rails 3.1 to Rails 3.2
|
113
216
|
-------------------------------------
|
114
217
|
|
115
218
|
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.
|
116
219
|
|
117
|
-
The following changes are meant for upgrading your application to Rails 3.2.
|
220
|
+
The following changes are meant for upgrading your application to Rails 3.2.12, the latest 3.2.x version of Rails.
|
118
221
|
|
119
222
|
### Gemfile
|
120
223
|
|
121
224
|
Make the following changes to your `Gemfile`.
|
122
225
|
|
123
226
|
```ruby
|
124
|
-
gem 'rails', '= 3.2.
|
227
|
+
gem 'rails', '= 3.2.12'
|
125
228
|
|
126
229
|
group :assets do
|
127
230
|
gem 'sass-rails', '~> 3.2.3'
|
@@ -161,14 +264,14 @@ Upgrading from Rails 3.0 to Rails 3.1
|
|
161
264
|
|
162
265
|
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.
|
163
266
|
|
164
|
-
The following changes are meant for upgrading your application to Rails 3.1.
|
267
|
+
The following changes are meant for upgrading your application to Rails 3.1.11, the latest 3.1.x version of Rails.
|
165
268
|
|
166
269
|
### Gemfile
|
167
270
|
|
168
271
|
Make the following changes to your `Gemfile`.
|
169
272
|
|
170
273
|
```ruby
|
171
|
-
gem 'rails', '= 3.1.
|
274
|
+
gem 'rails', '= 3.1.11'
|
172
275
|
gem 'mysql2'
|
173
276
|
|
174
277
|
# Needed for the new asset pipeline
|
@@ -394,3 +394,4 @@ Here are some helpful links to help you learn even more:
|
|
394
394
|
* [jquery-ujs list of external articles](https://github.com/rails/jquery-ujs/wiki/External-articles)
|
395
395
|
* [Rails 3 Remote Links and Forms: A Definitive Guide](http://www.alfajango.com/blog/rails-3-remote-links-and-forms/)
|
396
396
|
* [Railscasts: Unobtrusive JavaScript](http://railscasts.com/episodes/205-unobtrusive-javascript)
|
397
|
+
* [Railscasts: Turbolinks](http://railscasts.com/episodes/390-turbolinks)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.0.
|
4
|
+
version: 4.0.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,70 +16,70 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.0.0.
|
19
|
+
version: 4.0.0.rc1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 4.0.0.
|
26
|
+
version: 4.0.0.rc1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: actionpack
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 4.0.0.
|
33
|
+
version: 4.0.0.rc1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 4.0.0.
|
40
|
+
version: 4.0.0.rc1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: activerecord
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 4.0.0.
|
47
|
+
version: 4.0.0.rc1
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 4.0.0.
|
54
|
+
version: 4.0.0.rc1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: actionmailer
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 4.0.0.
|
61
|
+
version: 4.0.0.rc1
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 4.0.0.
|
68
|
+
version: 4.0.0.rc1
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: railties
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - '='
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 4.0.0.
|
75
|
+
version: 4.0.0.rc1
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - '='
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 4.0.0.
|
82
|
+
version: 4.0.0.rc1
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: bundler
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -106,14 +106,14 @@ dependencies:
|
|
106
106
|
requirements:
|
107
107
|
- - ~>
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: 2.0.0.
|
109
|
+
version: 2.0.0.rc4
|
110
110
|
type: :runtime
|
111
111
|
prerelease: false
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
114
|
- - ~>
|
115
115
|
- !ruby/object:Gem::Version
|
116
|
-
version: 2.0.0.
|
116
|
+
version: 2.0.0.rc4
|
117
117
|
description: Ruby on Rails is a full-stack web framework optimized for programmer
|
118
118
|
happiness and sustainable productivity. It encourages beautiful code by favoring
|
119
119
|
convention over configuration.
|
@@ -122,7 +122,7 @@ executables: []
|
|
122
122
|
extensions: []
|
123
123
|
extra_rdoc_files: []
|
124
124
|
files:
|
125
|
-
- README.
|
125
|
+
- README.md
|
126
126
|
- guides/assets/images/belongs_to.png
|
127
127
|
- guides/assets/images/book_icon.gif
|
128
128
|
- guides/assets/images/bullet.gif
|
@@ -261,8 +261,9 @@ files:
|
|
261
261
|
- guides/assets/stylesheets/syntaxhighlighter/shThemeMidnight.css
|
262
262
|
- guides/assets/stylesheets/syntaxhighlighter/shThemeRailsGuides.css
|
263
263
|
- guides/assets/stylesheets/syntaxhighlighter/shThemeRDark.css
|
264
|
+
- guides/bug_report_templates/active_record_gem.rb
|
265
|
+
- guides/bug_report_templates/active_record_master.rb
|
264
266
|
- guides/CHANGELOG.md
|
265
|
-
- guides/code/getting_started/app/assets/images/rails.png
|
266
267
|
- guides/code/getting_started/app/assets/javascripts/application.js
|
267
268
|
- guides/code/getting_started/app/assets/javascripts/comments.js.coffee
|
268
269
|
- guides/code/getting_started/app/assets/javascripts/posts.js.coffee
|
data/README.rdoc
DELETED
@@ -1,77 +0,0 @@
|
|
1
|
-
== Welcome to Rails
|
2
|
-
|
3
|
-
Rails is a web-application framework that includes everything needed to create
|
4
|
-
database-backed web applications according to the {Model-View-Controller (MVC)}[http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller] pattern.
|
5
|
-
|
6
|
-
Understanding the MVC pattern is key to understanding Rails. MVC divides your application
|
7
|
-
into three layers, each with a specific responsibility.
|
8
|
-
|
9
|
-
The View layer is composed of "templates" that are responsible for providing
|
10
|
-
appropriate representations of your application's resources. Templates
|
11
|
-
can come in a variety of formats, but most view templates are \HTML with embedded Ruby
|
12
|
-
code (.erb files).
|
13
|
-
|
14
|
-
The Model layer represents your domain model (such as Account, Product, Person, Post)
|
15
|
-
and encapsulates the business logic that is specific to your application. In Rails,
|
16
|
-
database-backed model classes are derived from ActiveRecord::Base. Active Record allows
|
17
|
-
you to present the data from database rows as objects and embellish these data objects
|
18
|
-
with business logic methods. Although most Rails models are backed by a database, models
|
19
|
-
can also be ordinary Ruby classes, or Ruby classes that implement a set of interfaces as
|
20
|
-
provided by the ActiveModel module. You can read more about Active Record in its
|
21
|
-
{README}[link:/rails/rails/blob/master/activerecord/README.rdoc].
|
22
|
-
|
23
|
-
The Controller layer is responsible for handling incoming HTTP requests and providing a
|
24
|
-
suitable response. Usually this means returning \HTML, but Rails controllers can also
|
25
|
-
generate XML, JSON, PDFs, mobile-specific views, and more. Controllers manipulate models
|
26
|
-
and render view templates in order to generate the appropriate HTTP response.
|
27
|
-
|
28
|
-
In Rails, the Controller and View layers are handled together by Action Pack.
|
29
|
-
These two layers are bundled in a single package due to their heavy interdependence.
|
30
|
-
This is unlike the relationship between Active Record and Action Pack, which are
|
31
|
-
independent. Each of these packages can be used independently outside of Rails. You
|
32
|
-
can read more about Action Pack in its {README}[link:/rails/rails/blob/master/actionpack/README.rdoc].
|
33
|
-
|
34
|
-
== Getting Started
|
35
|
-
|
36
|
-
1. Install Rails at the command prompt if you haven't yet:
|
37
|
-
|
38
|
-
gem install rails
|
39
|
-
|
40
|
-
2. At the command prompt, create a new Rails application:
|
41
|
-
|
42
|
-
rails new myapp
|
43
|
-
|
44
|
-
where "myapp" is the application name.
|
45
|
-
|
46
|
-
3. Change directory to +myapp+ and start the web server:
|
47
|
-
|
48
|
-
cd myapp; rails server
|
49
|
-
|
50
|
-
Run with <tt>--help</tt> or <tt>-h</tt> for options.
|
51
|
-
|
52
|
-
4. Go to http://localhost:3000 and you'll see:
|
53
|
-
|
54
|
-
"Welcome aboard: You're riding Ruby on Rails!"
|
55
|
-
|
56
|
-
5. Follow the guidelines to start developing your application. You may find the following resources handy:
|
57
|
-
|
58
|
-
* The README file created within your application.
|
59
|
-
* {Getting Started with Rails}[http://guides.rubyonrails.org/getting_started.html].
|
60
|
-
* {Ruby on Rails Tutorial}[http://ruby.railstutorial.org/ruby-on-rails-tutorial-book].
|
61
|
-
* {Ruby on Rails Guides}[http://guides.rubyonrails.org].
|
62
|
-
* {The API Documentation}[http://api.rubyonrails.org].
|
63
|
-
|
64
|
-
== Contributing
|
65
|
-
|
66
|
-
We encourage you to contribute to Ruby on Rails! Please check out the {Contributing to Rails
|
67
|
-
guide}[http://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html] for guidelines about how
|
68
|
-
to proceed. {Join us}[http://contributors.rubyonrails.org]!
|
69
|
-
|
70
|
-
== Code Status
|
71
|
-
|
72
|
-
* {<img src="https://secure.travis-ci.org/rails/rails.png"/>}[http://travis-ci.org/rails/rails]
|
73
|
-
* {<img src="https://gemnasium.com/rails/rails.png?travis"/>}[https://gemnasium.com/rails/rails]
|
74
|
-
|
75
|
-
== License
|
76
|
-
|
77
|
-
Ruby on Rails is released under the {MIT License}[http://www.opensource.org/licenses/MIT].
|
Binary file
|