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.

Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +20 -15
  3. data/guides/CHANGELOG.md +5 -74
  4. data/guides/assets/images/edge_badge.png +0 -0
  5. data/guides/assets/images/feature_tile.gif +0 -0
  6. data/guides/assets/images/footer_tile.gif +0 -0
  7. data/guides/assets/images/fxn.png +0 -0
  8. data/guides/assets/images/getting_started/challenge.png +0 -0
  9. data/guides/assets/images/getting_started/forbidden_attributes_for_new_post.png +0 -0
  10. data/guides/assets/images/getting_started/new_post.png +0 -0
  11. data/guides/assets/images/getting_started/routing_error_no_controller.png +0 -0
  12. data/guides/assets/images/getting_started/routing_error_no_route_matches.png +0 -0
  13. data/guides/assets/images/getting_started/template_is_missing_posts_new.png +0 -0
  14. data/guides/assets/images/getting_started/unknown_action_create_for_posts.png +0 -0
  15. data/guides/assets/images/getting_started/unknown_action_new_for_posts.png +0 -0
  16. data/guides/assets/images/header_tile.gif +0 -0
  17. data/guides/assets/images/icons/README +1 -1
  18. data/guides/assets/images/icons/callouts/11.png +0 -0
  19. data/guides/assets/images/icons/callouts/12.png +0 -0
  20. data/guides/assets/images/icons/callouts/13.png +0 -0
  21. data/guides/assets/images/icons/callouts/15.png +0 -0
  22. data/guides/assets/images/icons/caution.png +0 -0
  23. data/guides/assets/images/icons/example.png +0 -0
  24. data/guides/assets/images/radar.png +0 -0
  25. data/guides/assets/images/rails4_features.png +0 -0
  26. data/guides/assets/images/rails_guides_kindle_cover.jpg +0 -0
  27. data/guides/assets/images/vijaydev.jpg +0 -0
  28. data/guides/assets/javascripts/guides.js +30 -34
  29. data/guides/assets/stylesheets/main.css +2 -1
  30. data/guides/assets/stylesheets/print.css +1 -1
  31. data/guides/bug_report_templates/action_controller_gem.rb +2 -0
  32. data/guides/bug_report_templates/action_controller_master.rb +2 -0
  33. data/guides/bug_report_templates/active_record_gem.rb +1 -1
  34. data/guides/bug_report_templates/active_record_master.rb +2 -1
  35. data/guides/code/getting_started/Gemfile +1 -1
  36. data/guides/code/getting_started/app/assets/javascripts/application.js +1 -2
  37. data/guides/code/getting_started/config/environments/development.rb +1 -1
  38. data/guides/code/getting_started/public/404.html +2 -0
  39. data/guides/code/getting_started/public/422.html +2 -0
  40. data/guides/code/getting_started/public/500.html +2 -0
  41. data/guides/rails_guides/helpers.rb +1 -1
  42. data/guides/source/2_2_release_notes.md +2 -2
  43. data/guides/source/2_3_release_notes.md +8 -8
  44. data/guides/source/3_0_release_notes.md +1 -2
  45. data/guides/source/3_1_release_notes.md +1 -1
  46. data/guides/source/3_2_release_notes.md +12 -12
  47. data/guides/source/4_0_release_notes.md +79 -46
  48. data/guides/source/4_1_release_notes.md +601 -0
  49. data/guides/source/_welcome.html.erb +1 -1
  50. data/guides/source/action_controller_overview.md +117 -31
  51. data/guides/source/action_mailer_basics.md +19 -19
  52. data/guides/source/action_view_overview.md +131 -12
  53. data/guides/source/active_model_basics.md +6 -6
  54. data/guides/source/active_record_basics.md +15 -15
  55. data/guides/source/active_record_callbacks.md +18 -16
  56. data/guides/source/active_record_querying.md +67 -39
  57. data/guides/source/active_record_validations.md +31 -31
  58. data/guides/source/active_support_core_extensions.md +63 -74
  59. data/guides/source/active_support_instrumentation.md +13 -4
  60. data/guides/source/api_documentation_guidelines.md +19 -5
  61. data/guides/source/asset_pipeline.md +544 -249
  62. data/guides/source/association_basics.md +81 -22
  63. data/guides/source/caching_with_rails.md +15 -6
  64. data/guides/source/command_line.md +28 -19
  65. data/guides/source/configuring.md +98 -50
  66. data/guides/source/contributing_to_ruby_on_rails.md +11 -11
  67. data/guides/source/credits.html.erb +2 -2
  68. data/guides/source/debugging_rails_applications.md +36 -5
  69. data/guides/source/development_dependencies_install.md +89 -8
  70. data/guides/source/documents.yaml +7 -1
  71. data/guides/source/engines.md +648 -224
  72. data/guides/source/form_helpers.md +56 -45
  73. data/guides/source/generators.md +7 -3
  74. data/guides/source/getting_started.md +379 -164
  75. data/guides/source/i18n.md +59 -23
  76. data/guides/source/index.html.erb +1 -1
  77. data/guides/source/initialization.md +153 -56
  78. data/guides/source/kindle/toc.html.erb +1 -1
  79. data/guides/source/layout.html.erb +3 -3
  80. data/guides/source/layouts_and_rendering.md +12 -11
  81. data/guides/source/maintenance_policy.md +4 -23
  82. data/guides/source/migrations.md +41 -37
  83. data/guides/source/nested_model_forms.md +3 -3
  84. data/guides/source/plugins.md +27 -23
  85. data/guides/source/rails_application_templates.md +25 -6
  86. data/guides/source/rails_on_rack.md +35 -51
  87. data/guides/source/routing.md +108 -99
  88. data/guides/source/ruby_on_rails_guides_guidelines.md +2 -2
  89. data/guides/source/security.md +33 -31
  90. data/guides/source/testing.md +37 -34
  91. data/guides/source/upgrading_ruby_on_rails.md +335 -16
  92. data/guides/source/working_with_javascript_in_rails.md +18 -10
  93. metadata +66 -39
  94. data/guides/assets/images/jaimeiniesta.jpg +0 -0
  95. data/guides/source/kindle/KINDLE.md +0 -26
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f6f6960a78da480f91ecccaec3fd9a555ea83e7b
4
- data.tar.gz: a0c92a2f2a74a328c9602703c553a9208e545029
3
+ metadata.gz: becc6aec9f24c0bf27fb1d8780882ac587082870
4
+ data.tar.gz: 072ce3373d160444f5ea3a3cc6b5846e4feca01b
5
5
  SHA512:
6
- metadata.gz: ecf7ce48f8a9b9606c734aeb7b68f7364d2b97bdc5145d2af911fdb1cfafe3d6e2f56d6ec783e843bf249a77ff4d14f990bd218a78f08b33e4946f874f893a63
7
- data.tar.gz: dd524fa16bbf1cb9e0392857eb898f5b9babf55897729acf673f4977901f4a81a749e696238eb87e45839507b2aa14408213a5eda5d3dfabcd0a94de0d981bdc
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
- controllers can also generate XML, JSON, PDFs, mobile-specific views, and
29
- more. Controllers manipulate models and render view templates in order to
30
- generate the appropriate HTTP response.
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
- In Rails, the Controller and View layers are handled together by Action Pack.
33
- These two layers are bundled in a single package due to their heavy interdependence.
34
- This is unlike the relationship between Active Record and Action Pack, which are
35
- independent. Each of these packages can be used independently outside of Rails. You
36
- can read more about Action Pack in its [README](actionpack/README.rdoc).
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. Go to http://localhost:3000 and you'll see: "Welcome aboard: You're riding Ruby on Rails!"
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:
@@ -1,82 +1,13 @@
1
- ## Rails 4.0.13 (January 6, 2015) ##
1
+ * Fixed missing line and shadow on service pages(404, 422, 500).
2
2
 
3
- *No changes*
3
+ *Dmitry Korotkov*
4
4
 
5
+ * Removed repetitive th tags. Instead of them added one th tag with a colspan attribute.
5
6
 
6
- ## Rails 4.0.12 (November 16, 2014) ##
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
- ## Rails 4.0.0 (June 25, 2013) ##
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
@@ -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 incompatibilies.
3
+ from the Jimmac icons to get round MS IE and FOP PNG incompatibilities.
4
4
 
5
5
  Stuart Rackham
@@ -1,57 +1,53 @@
1
- function guideMenu(){
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:visible").click(function(e){
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
- $(document).on("click", function(e){
28
- var $button = $(".more-info-button");
29
- var element;
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
- // Cross browser find the element that had the event
32
- if (e.target) element = e.target;
33
- else if (e.srcElement) element = e.srcElement;
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
- // Defeat the older Safari bug:
36
- // http://www.quirksmode.org/js/events_properties.html
37
- if (element.nodeType == 3) element = element.parentNode;
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
- var $element = $(element);
37
+ var $element = $(element);
40
38
 
41
- var $container = $element.parents(".more-info-container");
39
+ var $container = $element.parents(".more-info-container");
42
40
 
43
- // We've captured a click outside the popup
44
- if($container.length == 0){
45
- $container = $button.next(".more-info-container");
46
- $container.find(".more-info-links").addClass("s-hidden").unwrap();
47
- $(document).off("click");
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: 0;
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; }
@@ -19,6 +19,8 @@ class TestApp < Rails::Application
19
19
  end
20
20
 
21
21
  class TestController < ActionController::Base
22
+ include Rails.application.routes.url_helpers
23
+
22
24
  def index
23
25
  render text: 'Home'
24
26
  end
@@ -28,6 +28,8 @@ class TestApp < Rails::Application
28
28
  end
29
29
 
30
30
  class TestController < ActionController::Base
31
+ include Rails.application.routes.url_helpers
32
+
31
33
  def index
32
34
  render text: 'Home'
33
35
  end
@@ -1,5 +1,5 @@
1
1
  # Activate the gem you are reporting the issue against.
2
- gem 'activerecord', '3.2.13'
2
+ gem 'activerecord', '4.0.0'
3
3
  require 'active_record'
4
4
  require 'minitest/autorun'
5
5
  require 'logger'
@@ -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 < MiniTest::Unit::TestCase
40
+ class BugTest < Minitest::Test
40
41
  def test_association_stuff
41
42
  post = Post.create!
42
43
  post.comments << Comment.create!
@@ -31,7 +31,7 @@ end
31
31
  gem 'jbuilder', '~> 1.2'
32
32
 
33
33
  # To use ActiveModel has_secure_password
34
- # gem 'bcrypt', '~> 3.1.7'
34
+ # gem 'bcrypt-ruby', '~> 3.1.2'
35
35
 
36
36
  # Use unicorn as the app server
37
37
  # gem 'unicorn'
@@ -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
- // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
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;