rails 4.0.13 → 4.1.0.beta1
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 +20 -15
- data/guides/CHANGELOG.md +5 -74
- data/guides/assets/images/edge_badge.png +0 -0
- data/guides/assets/images/feature_tile.gif +0 -0
- data/guides/assets/images/footer_tile.gif +0 -0
- data/guides/assets/images/fxn.png +0 -0
- data/guides/assets/images/getting_started/challenge.png +0 -0
- data/guides/assets/images/getting_started/forbidden_attributes_for_new_post.png +0 -0
- data/guides/assets/images/getting_started/new_post.png +0 -0
- data/guides/assets/images/getting_started/routing_error_no_controller.png +0 -0
- data/guides/assets/images/getting_started/routing_error_no_route_matches.png +0 -0
- data/guides/assets/images/getting_started/template_is_missing_posts_new.png +0 -0
- data/guides/assets/images/getting_started/unknown_action_create_for_posts.png +0 -0
- data/guides/assets/images/getting_started/unknown_action_new_for_posts.png +0 -0
- data/guides/assets/images/header_tile.gif +0 -0
- data/guides/assets/images/icons/README +1 -1
- data/guides/assets/images/icons/callouts/11.png +0 -0
- data/guides/assets/images/icons/callouts/12.png +0 -0
- data/guides/assets/images/icons/callouts/13.png +0 -0
- data/guides/assets/images/icons/callouts/15.png +0 -0
- data/guides/assets/images/icons/caution.png +0 -0
- data/guides/assets/images/icons/example.png +0 -0
- data/guides/assets/images/radar.png +0 -0
- data/guides/assets/images/rails4_features.png +0 -0
- data/guides/assets/images/rails_guides_kindle_cover.jpg +0 -0
- data/guides/assets/images/vijaydev.jpg +0 -0
- data/guides/assets/javascripts/guides.js +30 -34
- data/guides/assets/stylesheets/main.css +2 -1
- data/guides/assets/stylesheets/print.css +1 -1
- data/guides/bug_report_templates/action_controller_gem.rb +2 -0
- data/guides/bug_report_templates/action_controller_master.rb +2 -0
- data/guides/bug_report_templates/active_record_gem.rb +1 -1
- data/guides/bug_report_templates/active_record_master.rb +2 -1
- data/guides/code/getting_started/Gemfile +1 -1
- data/guides/code/getting_started/app/assets/javascripts/application.js +1 -2
- data/guides/code/getting_started/config/environments/development.rb +1 -1
- data/guides/code/getting_started/public/404.html +2 -0
- data/guides/code/getting_started/public/422.html +2 -0
- data/guides/code/getting_started/public/500.html +2 -0
- data/guides/rails_guides/helpers.rb +1 -1
- data/guides/source/2_2_release_notes.md +2 -2
- data/guides/source/2_3_release_notes.md +8 -8
- data/guides/source/3_0_release_notes.md +1 -2
- data/guides/source/3_1_release_notes.md +1 -1
- data/guides/source/3_2_release_notes.md +12 -12
- data/guides/source/4_0_release_notes.md +79 -46
- data/guides/source/4_1_release_notes.md +601 -0
- data/guides/source/_welcome.html.erb +1 -1
- data/guides/source/action_controller_overview.md +117 -31
- data/guides/source/action_mailer_basics.md +19 -19
- data/guides/source/action_view_overview.md +131 -12
- data/guides/source/active_model_basics.md +6 -6
- data/guides/source/active_record_basics.md +15 -15
- data/guides/source/active_record_callbacks.md +18 -16
- data/guides/source/active_record_querying.md +67 -39
- data/guides/source/active_record_validations.md +31 -31
- data/guides/source/active_support_core_extensions.md +63 -74
- data/guides/source/active_support_instrumentation.md +13 -4
- data/guides/source/api_documentation_guidelines.md +19 -5
- data/guides/source/asset_pipeline.md +544 -249
- data/guides/source/association_basics.md +81 -22
- data/guides/source/caching_with_rails.md +15 -6
- data/guides/source/command_line.md +28 -19
- data/guides/source/configuring.md +98 -50
- data/guides/source/contributing_to_ruby_on_rails.md +11 -11
- data/guides/source/credits.html.erb +2 -2
- data/guides/source/debugging_rails_applications.md +36 -5
- data/guides/source/development_dependencies_install.md +89 -8
- data/guides/source/documents.yaml +7 -1
- data/guides/source/engines.md +648 -224
- data/guides/source/form_helpers.md +56 -45
- data/guides/source/generators.md +7 -3
- data/guides/source/getting_started.md +379 -164
- data/guides/source/i18n.md +59 -23
- data/guides/source/index.html.erb +1 -1
- data/guides/source/initialization.md +153 -56
- data/guides/source/kindle/toc.html.erb +1 -1
- data/guides/source/layout.html.erb +3 -3
- data/guides/source/layouts_and_rendering.md +12 -11
- data/guides/source/maintenance_policy.md +4 -23
- data/guides/source/migrations.md +41 -37
- data/guides/source/nested_model_forms.md +3 -3
- data/guides/source/plugins.md +27 -23
- data/guides/source/rails_application_templates.md +25 -6
- data/guides/source/rails_on_rack.md +35 -51
- data/guides/source/routing.md +108 -99
- data/guides/source/ruby_on_rails_guides_guidelines.md +2 -2
- data/guides/source/security.md +33 -31
- data/guides/source/testing.md +37 -34
- data/guides/source/upgrading_ruby_on_rails.md +335 -16
- data/guides/source/working_with_javascript_in_rails.md +18 -10
- metadata +66 -39
- data/guides/assets/images/jaimeiniesta.jpg +0 -0
- data/guides/source/kindle/KINDLE.md +0 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: becc6aec9f24c0bf27fb1d8780882ac587082870
|
4
|
+
data.tar.gz: 072ce3373d160444f5ea3a3cc6b5846e4feca01b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d3f8296679404d12955c227b1447670ca267d7b74414addd0fe8962c973fd10b55ac6b941145cc19ad2ce07592e4b8017de88fa1b6929292f8cb70c953c5cc2
|
7
|
+
data.tar.gz: 2176709a9fc9ffc0637f7258dbe622ff595c17215de83f7113540a2e14c7f0eeb4ca5bafbe207c1427fd7c7ba83fe56856c0035f54f659682899294479f0162e
|
data/README.md
CHANGED
@@ -8,11 +8,6 @@ pattern.
|
|
8
8
|
Understanding the MVC pattern is key to understanding Rails. MVC divides your
|
9
9
|
application into three layers, each with a specific responsibility.
|
10
10
|
|
11
|
-
The _View layer_ is composed of "templates" that are responsible for providing
|
12
|
-
appropriate representations of your application's resources. Templates can
|
13
|
-
come in a variety of formats, but most view templates are HTML with embedded
|
14
|
-
Ruby code (ERB files).
|
15
|
-
|
16
11
|
The _Model layer_ represents your domain model (such as Account, Product,
|
17
12
|
Person, Post, etc.) and encapsulates the business logic that is specific to
|
18
13
|
your application. In Rails, database-backed model classes are derived from
|
@@ -24,16 +19,26 @@ as provided by the Active Model module. You can read more about Active Record
|
|
24
19
|
in its [README](activerecord/README.rdoc).
|
25
20
|
|
26
21
|
The _Controller layer_ is responsible for handling incoming HTTP requests and
|
27
|
-
providing a suitable response. Usually this means returning HTML, but Rails
|
28
|
-
|
29
|
-
|
30
|
-
|
22
|
+
providing a suitable response. Usually this means returning HTML, but Rails controllers
|
23
|
+
can also generate XML, JSON, PDFs, mobile-specific views, and more. Controllers load and
|
24
|
+
manipulate models, and render view templates in order to generate the appropriate HTTP response.
|
25
|
+
In Rails, incoming requests are routed by Action Dispatch to an appropriate controller, and
|
26
|
+
controller classes are derived from `ActionController::Base`. Action Dispatch and Action Controller
|
27
|
+
are bundled together in Action Pack. You can read more about Action Pack in its
|
28
|
+
[README](actionpack/README.rdoc).
|
29
|
+
|
30
|
+
The _View layer_ is composed of "templates" that are responsible for providing
|
31
|
+
appropriate representations of your application's resources. Templates can
|
32
|
+
come in a variety of formats, but most view templates are HTML with embedded
|
33
|
+
Ruby code (ERB files). Views are typically rendered to generate a controller response,
|
34
|
+
or to generate the body of an email. In Rails, View generation is handled by Action View.
|
35
|
+
You can read more about Action View in its [README](actionview/README.rdoc).
|
31
36
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
+
Active Record, Action Pack, and Action View can each be used independently outside Rails.
|
38
|
+
In addition to them, Rails also comes with Action Mailer ([README](actionmailer/README.rdoc)), a library
|
39
|
+
to generate and send emails; and Active Support ([README](activesupport/README.rdoc)), a collection of
|
40
|
+
utility classes and standard library extensions that are useful for Rails, and may also be used
|
41
|
+
independently outside Rails.
|
37
42
|
|
38
43
|
## Getting Started
|
39
44
|
|
@@ -54,7 +59,7 @@ can read more about Action Pack in its [README](actionpack/README.rdoc).
|
|
54
59
|
|
55
60
|
Run with `--help` or `-h` for options.
|
56
61
|
|
57
|
-
4.
|
62
|
+
4. Using a browser, go to http://localhost:3000 and you'll see: "Welcome aboard: You're riding Ruby on Rails!"
|
58
63
|
|
59
64
|
5. Follow the guidelines to start developing your application. You may find
|
60
65
|
the following resources handy:
|
data/guides/CHANGELOG.md
CHANGED
@@ -1,82 +1,13 @@
|
|
1
|
-
|
1
|
+
* Fixed missing line and shadow on service pages(404, 422, 500).
|
2
2
|
|
3
|
-
*
|
3
|
+
*Dmitry Korotkov*
|
4
4
|
|
5
|
+
* Removed repetitive th tags. Instead of them added one th tag with a colspan attribute.
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
*No changes*
|
9
|
-
|
10
|
-
|
11
|
-
## Rails 4.0.11.1 (November 19, 2014) ##
|
12
|
-
|
13
|
-
*No changes*
|
14
|
-
|
15
|
-
|
16
|
-
## Rails 4.0.11 (September 11, 2014) ##
|
17
|
-
|
18
|
-
*No changes*
|
19
|
-
|
20
|
-
|
21
|
-
## Rails 4.0.10 (September 11, 2014) ##
|
22
|
-
|
23
|
-
*No changes*
|
24
|
-
|
25
|
-
|
26
|
-
## Rails 4.0.9 (August 18, 2014) ##
|
27
|
-
|
28
|
-
*No changes*
|
29
|
-
|
30
|
-
|
31
|
-
## Rails 4.0.8 (July 2, 2014) ##
|
32
|
-
|
33
|
-
*No changes*
|
34
|
-
|
35
|
-
|
36
|
-
## Rails 4.0.7 (July 2, 2014) ##
|
37
|
-
|
38
|
-
*No changes*
|
39
|
-
|
40
|
-
|
41
|
-
## Rails 4.0.6 (June 26, 2014) ##
|
42
|
-
|
43
|
-
*No changes*
|
44
|
-
|
45
|
-
|
46
|
-
## Rails 4.0.5 (May 6, 2014) ##
|
47
|
-
|
48
|
-
*No changes*
|
49
|
-
|
50
|
-
|
51
|
-
## Rails 4.0.4 (March 14, 2014) ##
|
52
|
-
|
53
|
-
*No changes*
|
54
|
-
|
55
|
-
|
56
|
-
## Rails 4.0.3 (February 18, 2014) ##
|
57
|
-
|
58
|
-
*No changes*
|
59
|
-
|
60
|
-
|
61
|
-
## Rails 4.0.2 (December 02, 2013) ##
|
62
|
-
|
63
|
-
*No changes*
|
64
|
-
|
65
|
-
|
66
|
-
## Rails 4.0.1 (November 01, 2013) ##
|
7
|
+
*Sıtkı Bağdat*
|
67
8
|
|
68
9
|
* Added the Rails maintenance policy to the guides.
|
69
10
|
|
70
11
|
*Matias Korhonen*
|
71
12
|
|
72
|
-
|
73
|
-
|
74
|
-
* Change Service pages(404, etc). *Stanislav Sobolev*
|
75
|
-
|
76
|
-
* Split Validations and Callbacks guide into two. *Steve Klabnik*
|
77
|
-
|
78
|
-
* New guide _Working with JavaScript in Rails_. *Steve Klabnik*
|
79
|
-
|
80
|
-
* Guides updated to reflect new test locations. *Mike Moore*
|
81
|
-
|
82
|
-
* Guides have a responsive design. *Joe Fiorini*
|
13
|
+
Please check [4-0-stable](https://github.com/rails/rails/blob/4-0-stable/guides/CHANGELOG.md) for previous changes.
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,5 +1,5 @@
|
|
1
1
|
Replaced the plain DocBook XSL admonition icons with Jimmac's DocBook
|
2
2
|
icons (http://jimmac.musichall.cz/ikony.php3). I dropped transparency
|
3
|
-
from the Jimmac icons to get round MS IE and FOP PNG
|
3
|
+
from the Jimmac icons to get round MS IE and FOP PNG incompatibilities.
|
4
4
|
|
5
5
|
Stuart Rackham
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,57 +1,53 @@
|
|
1
|
-
function
|
2
|
-
if (document.getElementById('guides').style.display == "none") {
|
3
|
-
document.getElementById('guides').style.display = "block";
|
4
|
-
} else {
|
5
|
-
document.getElementById('guides').style.display = "none";
|
6
|
-
}
|
7
|
-
}
|
8
|
-
|
9
|
-
$.fn.selectGuide = function(guide){
|
1
|
+
$.fn.selectGuide = function(guide) {
|
10
2
|
$("select", this).val(guide);
|
11
|
-
}
|
3
|
+
};
|
12
4
|
|
13
|
-
guidesIndex = {
|
14
|
-
bind: function(){
|
5
|
+
var guidesIndex = {
|
6
|
+
bind: function() {
|
15
7
|
var currentGuidePath = window.location.pathname;
|
16
8
|
var currentGuide = currentGuidePath.substring(currentGuidePath.lastIndexOf("/")+1);
|
17
9
|
$(".guides-index-small").
|
18
10
|
on("change", "select", guidesIndex.navigate).
|
19
11
|
selectGuide(currentGuide);
|
20
|
-
$(".more-info-button
|
12
|
+
$(document).on("click", ".more-info-button", function(e){
|
21
13
|
e.stopPropagation();
|
22
|
-
if($(".more-info-links").is(":visible")){
|
14
|
+
if ($(".more-info-links").is(":visible")) {
|
23
15
|
$(".more-info-links").addClass("s-hidden").unwrap();
|
24
16
|
} else {
|
25
17
|
$(".more-info-links").wrap("<div class='more-info-container'></div>").removeClass("s-hidden");
|
26
18
|
}
|
27
|
-
|
28
|
-
|
29
|
-
|
19
|
+
});
|
20
|
+
$("#guidesMenu").on("click", function(e) {
|
21
|
+
$("#guides").toggle();
|
22
|
+
return false;
|
23
|
+
});
|
24
|
+
$(document).on("click", function(e){
|
25
|
+
e.stopPropagation();
|
26
|
+
var $button = $(".more-info-button");
|
27
|
+
var element;
|
30
28
|
|
31
|
-
|
32
|
-
|
33
|
-
|
29
|
+
// Cross browser find the element that had the event
|
30
|
+
if (e.target) element = e.target;
|
31
|
+
else if (e.srcElement) element = e.srcElement;
|
34
32
|
|
35
|
-
|
36
|
-
|
37
|
-
|
33
|
+
// Defeat the older Safari bug:
|
34
|
+
// http://www.quirksmode.org/js/events_properties.html
|
35
|
+
if (element.nodeType === 3) element = element.parentNode;
|
38
36
|
|
39
|
-
|
37
|
+
var $element = $(element);
|
40
38
|
|
41
|
-
|
39
|
+
var $container = $element.parents(".more-info-container");
|
42
40
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
}
|
49
|
-
});
|
41
|
+
// We've captured a click outside the popup
|
42
|
+
if($container.length === 0){
|
43
|
+
$container = $button.next(".more-info-container");
|
44
|
+
$container.find(".more-info-links").addClass("s-hidden").unwrap();
|
45
|
+
}
|
50
46
|
});
|
51
47
|
},
|
52
48
|
navigate: function(e){
|
53
49
|
var $list = $(e.target);
|
54
|
-
url = $list.val();
|
50
|
+
var url = $list.val();
|
55
51
|
window.location = url;
|
56
52
|
}
|
57
|
-
}
|
53
|
+
};
|
@@ -129,6 +129,7 @@ body {
|
|
129
129
|
font-family: Helvetica, Arial, Sans-Serif;
|
130
130
|
text-decoration: none;
|
131
131
|
vertical-align: middle;
|
132
|
+
cursor: pointer;
|
132
133
|
}
|
133
134
|
.red-button:active {
|
134
135
|
border-top: none;
|
@@ -244,7 +245,7 @@ body {
|
|
244
245
|
#subCol {
|
245
246
|
position: absolute;
|
246
247
|
z-index: 0;
|
247
|
-
top:
|
248
|
+
top: 21px;
|
248
249
|
right: 0;
|
249
250
|
background: #FFF;
|
250
251
|
padding: 1em 1.5em 1em 1.25em;
|
@@ -36,7 +36,7 @@ hr {
|
|
36
36
|
}
|
37
37
|
|
38
38
|
h1,h2,h3,h4,h5,h6 { font-family: "Helvetica Neue", Arial, "Lucida Grande", sans-serif; }
|
39
|
-
code { font:.9em "Courier New", Monaco, Courier, monospace; }
|
39
|
+
code { font:.9em "Courier New", Monaco, Courier, monospace; display:inline}
|
40
40
|
|
41
41
|
img { float:left; margin:1.5em 1.5em 1.5em 0; }
|
42
42
|
a img { border:none; }
|
@@ -2,6 +2,7 @@ unless File.exist?('Gemfile')
|
|
2
2
|
File.write('Gemfile', <<-GEMFILE)
|
3
3
|
source 'https://rubygems.org'
|
4
4
|
gem 'rails', github: 'rails/rails'
|
5
|
+
gem 'arel', github: 'rails/arel'
|
5
6
|
gem 'sqlite3'
|
6
7
|
GEMFILE
|
7
8
|
|
@@ -36,7 +37,7 @@ class Comment < ActiveRecord::Base
|
|
36
37
|
belongs_to :post
|
37
38
|
end
|
38
39
|
|
39
|
-
class BugTest <
|
40
|
+
class BugTest < Minitest::Test
|
40
41
|
def test_association_stuff
|
41
42
|
post = Post.create!
|
42
43
|
post.comments << Comment.create!
|
@@ -7,8 +7,7 @@
|
|
7
7
|
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
8
|
// compiled file.
|
9
9
|
//
|
10
|
-
//
|
11
|
-
// GO AFTER THE REQUIRES BELOW.
|
10
|
+
// stub path allows dependency to be excluded from the asset bundle.
|
12
11
|
//
|
13
12
|
//= require jquery
|
14
13
|
//= require jquery_ujs
|
@@ -22,7 +22,7 @@ Blog::Application.configure do
|
|
22
22
|
# Only use best-standards-support built into browsers.
|
23
23
|
config.action_dispatch.best_standards_support = :builtin
|
24
24
|
|
25
|
-
# Raise an error on page load if there are pending migrations
|
25
|
+
# Raise an error on page load if there are pending migrations.
|
26
26
|
config.active_record.migration_error = :page_load
|
27
27
|
|
28
28
|
# Debug mode disables concatenation and preprocessing of assets.
|
@@ -22,6 +22,7 @@
|
|
22
22
|
border-top-right-radius: 9px;
|
23
23
|
background-color: white;
|
24
24
|
padding: 7px 4em 0 4em;
|
25
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
25
26
|
}
|
26
27
|
|
27
28
|
h1 {
|
@@ -37,6 +38,7 @@
|
|
37
38
|
background-color: #F7F7F7;
|
38
39
|
border: 1px solid #CCC;
|
39
40
|
border-right-color: #999;
|
41
|
+
border-left-color: #999;
|
40
42
|
border-bottom-color: #999;
|
41
43
|
border-bottom-left-radius: 4px;
|
42
44
|
border-bottom-right-radius: 4px;
|
@@ -22,6 +22,7 @@
|
|
22
22
|
border-top-right-radius: 9px;
|
23
23
|
background-color: white;
|
24
24
|
padding: 7px 4em 0 4em;
|
25
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
25
26
|
}
|
26
27
|
|
27
28
|
h1 {
|
@@ -37,6 +38,7 @@
|
|
37
38
|
background-color: #F7F7F7;
|
38
39
|
border: 1px solid #CCC;
|
39
40
|
border-right-color: #999;
|
41
|
+
border-left-color: #999;
|
40
42
|
border-bottom-color: #999;
|
41
43
|
border-bottom-left-radius: 4px;
|
42
44
|
border-bottom-right-radius: 4px;
|
@@ -22,6 +22,7 @@
|
|
22
22
|
border-top-right-radius: 9px;
|
23
23
|
background-color: white;
|
24
24
|
padding: 7px 4em 0 4em;
|
25
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
25
26
|
}
|
26
27
|
|
27
28
|
h1 {
|
@@ -37,6 +38,7 @@
|
|
37
38
|
background-color: #F7F7F7;
|
38
39
|
border: 1px solid #CCC;
|
39
40
|
border-right-color: #999;
|
41
|
+
border-left-color: #999;
|
40
42
|
border-bottom-color: #999;
|
41
43
|
border-bottom-left-radius: 4px;
|
42
44
|
border-bottom-right-radius: 4px;
|