From 60aee4ea0e10a35ce5247b7be0e8576765ff9bc9 Mon Sep 17 00:00:00 2001
From: Ben Pickles
Date: Tue, 1 May 2012 16:38:35 +0200
Subject: [PATCH 01/20] Lowercase.
---
activerecord/lib/active_record/relation/calculations.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/activerecord/lib/active_record/relation/calculations.rb b/activerecord/lib/active_record/relation/calculations.rb
index f388b75c05..3ce9995031 100644
--- a/activerecord/lib/active_record/relation/calculations.rb
+++ b/activerecord/lib/active_record/relation/calculations.rb
@@ -144,7 +144,7 @@ module ActiveRecord
# Examples:
#
# Person.ids # SELECT people.id FROM people
- # Person.joins(:companies).ids # SELECT people.id FROM PEOPLE INNER JOIN companies ON companies.person_id = people.id
+ # Person.joins(:companies).ids # SELECT people.id FROM people INNER JOIN companies ON companies.person_id = people.id
def ids
pluck primary_key
end
From 068e8b20b574395e6d38480f5f124fbd3dd5a370 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hrvoje=20=C5=A0imi=C4=87?=
Date: Tue, 1 May 2012 18:25:37 +0200
Subject: [PATCH 02/20] simpler wording and explanations
---
activerecord/lib/active_record/aggregations.rb | 6 +++---
activerecord/lib/active_record/associations.rb | 16 ++++++++--------
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/activerecord/lib/active_record/aggregations.rb b/activerecord/lib/active_record/aggregations.rb
index c39284539c..bf1c73209e 100644
--- a/activerecord/lib/active_record/aggregations.rb
+++ b/activerecord/lib/active_record/aggregations.rb
@@ -101,8 +101,8 @@ module ActiveRecord
# ActiveRecord::Base classes are entity objects.
#
# It's also important to treat the value objects as immutable. Don't allow the Money object to have
- # its amount changed after creation. Create a new Money object with the new value instead. This
- # is exemplified by the Money#exchange_to method that returns a new value object instead of changing
+ # its amount changed after creation. Create a new Money object with the new value instead. The
+ # Money#exchange_to method is an example of this. It returns a new value object instead of changing
# its own values. Active Record won't persist value objects that have been changed through means
# other than the writer method.
#
@@ -119,7 +119,7 @@ module ActiveRecord
# option, as arguments. If the value class doesn't support this convention then +composed_of+ allows
# a custom constructor to be specified.
#
- # When a new value is assigned to the value object the default assumption is that the new value
+ # When a new value is assigned to the value object, the default assumption is that the new value
# is an instance of the value class. Specifying a custom converter allows the new value to be automatically
# converted to an instance of value class if necessary.
#
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb
index b901f06ca4..c7a24de11d 100644
--- a/activerecord/lib/active_record/associations.rb
+++ b/activerecord/lib/active_record/associations.rb
@@ -1129,7 +1129,7 @@ module ActiveRecord
# it would skip the first 4 rows.
# [:select]
# By default, this is * as in SELECT * FROM, but can be changed if
- # you, for example, want to do a join but not include the joined columns. Do not forget
+ # you want to do a join but not include the joined columns, for example. Do not forget
# to include the primary and foreign keys, otherwise it will raise an error.
# [:as]
# Specifies a polymorphic interface (See belongs_to).
@@ -1264,8 +1264,8 @@ module ActiveRecord
# [:as]
# Specifies a polymorphic interface (See belongs_to).
# [:select]
- # By default, this is * as in SELECT * FROM, but can be changed if, for example,
- # you want to do a join but not include the joined columns. Do not forget to include the
+ # By default, this is * as in SELECT * FROM, but can be changed if
+ # you want to do a join but not include the joined columns, for example. Do not forget to include the
# primary and foreign keys, otherwise it will raise an error.
# [:through]
# Specifies a Join Model through which to perform the query. Options for :class_name,
@@ -1355,7 +1355,7 @@ module ActiveRecord
# SQL fragment, such as authorized = 1.
# [:select]
# By default, this is * as in SELECT * FROM, but can be changed
- # if, for example, you want to do a join but not include the joined columns. Do not
+ # if you want to do a join but not include the joined columns, for example. Do not
# forget to include the primary and foreign keys, otherwise it will raise an error.
# [:foreign_key]
# Specify the foreign key used for the association. By default this is guessed to be the name
@@ -1382,7 +1382,7 @@ module ActiveRecord
# and +decrement_counter+. The counter cache is incremented when an object of this
# class is created and decremented when it's destroyed. This requires that a column
# named #{table_name}_count (such as +comments_count+ for a belonging Comment class)
- # is used on the associate class (such as a Post class) - that is the migration for
+ # is used on the associate class (such as a Post class) - that is the migration for
# #{table_name}_count is created on the associate class (such that Post.comments_count will
# return the count cached, see note below). You can also specify a custom counter
# cache column by providing a column name instead of a +true+/+false+ value to this
@@ -1432,7 +1432,7 @@ module ActiveRecord
# Specifies a many-to-many relationship with another class. This associates two classes via an
# intermediate join table. Unless the join table is explicitly specified as an option, it is
# guessed using the lexical order of the class names. So a join between Developer and Project
- # will give the default join table name of "developers_projects" because "D" outranks "P".
+ # will give the default join table name of "developers_projects" because "D" precedes "P" alphabetically.
# Note that this precedence is calculated using the < operator for String. This
# means that if the strings are of different lengths, and the strings are equal when compared
# up to the shortest length, then the longer string is considered of higher
@@ -1576,8 +1576,8 @@ module ActiveRecord
# An integer determining the offset from where the rows should be fetched. So at 5,
# it would skip the first 4 rows.
# [:select]
- # By default, this is * as in SELECT * FROM, but can be changed if, for example,
- # you want to do a join but not include the joined columns. Do not forget to include the primary
+ # By default, this is * as in SELECT * FROM, but can be changed if
+ # you want to do a join but exclude the joined columns, for example. Do not forget to include the primary
# and foreign keys, otherwise it will raise an error.
# [:readonly]
# If true, all the associated objects are readonly through the association.
From d752eabde35be96f9d8ab913b21c04e7f6aec485 Mon Sep 17 00:00:00 2001
From: Edward Tsech
Date: Tue, 1 May 2012 20:52:41 +0200
Subject: [PATCH 03/20] Add few lines to describe how aggregation part caching
works. [ci skip]
---
activerecord/lib/active_record/aggregations.rb | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/activerecord/lib/active_record/aggregations.rb b/activerecord/lib/active_record/aggregations.rb
index bf1c73209e..25ab826a13 100644
--- a/activerecord/lib/active_record/aggregations.rb
+++ b/activerecord/lib/active_record/aggregations.rb
@@ -86,6 +86,10 @@ module ActiveRecord
# customer.address_street = "Hyancintvej"
# customer.address_city = "Copenhagen"
# customer.address # => Address.new("Hyancintvej", "Copenhagen")
+ # customer.address_street = "Vesterbrogade"
+ # customer.address # => Address.new("Hyancintvej", "Copenhagen")
+ # customer.clear_aggregation_cache
+ # customer.address # => Address.new("Vesterbrogade", "Copenhagen")
# customer.address = Address.new("May Street", "Chicago")
# customer.address_street # => "May Street"
# customer.address_city # => "Chicago"
From 3305256c95d0d2a621ce85461b881a723cc2d0d3 Mon Sep 17 00:00:00 2001
From: Edward Tsech
Date: Tue, 1 May 2012 21:19:58 +0200
Subject: [PATCH 04/20] Add empty rows to improve readability. [ci skip]
---
activerecord/lib/active_record/aggregations.rb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/activerecord/lib/active_record/aggregations.rb b/activerecord/lib/active_record/aggregations.rb
index 25ab826a13..a4db627535 100644
--- a/activerecord/lib/active_record/aggregations.rb
+++ b/activerecord/lib/active_record/aggregations.rb
@@ -86,10 +86,12 @@ module ActiveRecord
# customer.address_street = "Hyancintvej"
# customer.address_city = "Copenhagen"
# customer.address # => Address.new("Hyancintvej", "Copenhagen")
+ #
# customer.address_street = "Vesterbrogade"
# customer.address # => Address.new("Hyancintvej", "Copenhagen")
# customer.clear_aggregation_cache
# customer.address # => Address.new("Vesterbrogade", "Copenhagen")
+ #
# customer.address = Address.new("May Street", "Chicago")
# customer.address_street # => "May Street"
# customer.address_city # => "Chicago"
From e1724b553e25339cd09df325523cce2f76f464f0 Mon Sep 17 00:00:00 2001
From: Rodrigo Pavano
Date: Tue, 1 May 2012 19:18:53 -0300
Subject: [PATCH 05/20] Documentation fix in options_for_select helper. Fixed
display errors caused by mixing Ruby and HTML code inside the same pre tag
[ci skip]
---
.../helpers/form_options_helper.rb | 35 ++++++++++++++-----
1 file changed, 26 insertions(+), 9 deletions(-)
diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionpack/lib/action_view/helpers/form_options_helper.rb
index d61c2bbee2..cafcd93f58 100644
--- a/actionpack/lib/action_view/helpers/form_options_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_options_helper.rb
@@ -288,38 +288,55 @@ module ActionView
#
# Examples (call, result):
# options_for_select([["Dollar", "$"], ["Kroner", "DKK"]])
- # \n
+ # #
+ # #
#
# options_for_select([ "VISA", "MasterCard" ], "MasterCard")
- # \n
+ # #
+ # #
#
# options_for_select({ "Basic" => "$20", "Plus" => "$40" }, "$40")
- # \n
+ # #
+ # #
#
# options_for_select([ "VISA", "MasterCard", "Discover" ], ["VISA", "Discover"])
- # \n\n
+ # #
+ # #
+ # #
#
# You can optionally provide html attributes as the last element of the array.
#
# Examples:
# options_for_select([ "Denmark", ["USA", {:class => 'bold'}], "Sweden" ], ["USA", "Sweden"])
- # \n\n
+ # #
+ # #
+ # #
#
# options_for_select([["Dollar", "$", {:class => "bold"}], ["Kroner", "DKK", {:onclick => "alert('HI');"}]])
- # \n
+ # #
+ # #
#
# If you wish to specify disabled option tags, set +selected+ to be a hash, with :disabled being either a value
# or array of values to be disabled. In this case, you can use :selected to specify selected option tags.
#
# Examples:
# options_for_select(["Free", "Basic", "Advanced", "Super Platinum"], :disabled => "Super Platinum")
- # \n\n\n
+ # #
+ # #
+ # #
+ # #
#
# options_for_select(["Free", "Basic", "Advanced", "Super Platinum"], :disabled => ["Advanced", "Super Platinum"])
- # \n\n\n
+ # #
+ # #
+ # #
+ # #
#
# options_for_select(["Free", "Basic", "Advanced", "Super Platinum"], :selected => "Free", :disabled => "Super Platinum")
- # \n\n\n
+ # #
+ # #
+ # #
+ # #
#
# NOTE: Only the option tags are returned, you have to wrap this call in a regular HTML select tag.
def options_for_select(container, selected = nil)
From 7b9faf7b283c55d35124a3c665f170663994124b Mon Sep 17 00:00:00 2001
From: Alexey Vakhov
Date: Wed, 2 May 2012 09:20:50 +0400
Subject: [PATCH 06/20] Fix form tag with non GET/POST method example
---
actionpack/lib/action_view/helpers/form_tag_helper.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb
index b5e0970612..ef35a411ad 100644
--- a/actionpack/lib/action_view/helpers/form_tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb
@@ -45,7 +45,7 @@ module ActionView
# # =>
<% end %>
-
-
<%= link_to 'Edit Post', edit_post_path(@post) %> |
-<%= link_to 'Back to Posts', posts_path %> |
+<%= link_to 'Back to Posts', posts_path %>
Now you can add posts and comments to your blog and have them show up in the
right places.
+!images/getting_started/post_with_comments.png(Post with Comments)!
+
h3. Refactoring
Now that we have posts and comments working, take a look at the
From 323d2c42c3782db9e30b37abb4787fe73d6d7c8d Mon Sep 17 00:00:00 2001
From: Oscar Del Ben
Date: Wed, 2 May 2012 11:13:20 +0200
Subject: [PATCH 11/20] Rewrite refactoring section in getting started guide
---
.../app/views/comments/_comment.html.erb | 8 +--
.../app/views/comments/_form.html.erb | 12 ++--
.../app/views/posts/show.html.erb | 26 +-------
guides/source/getting_started.textile | 65 +++++++------------
4 files changed, 34 insertions(+), 77 deletions(-)
diff --git a/guides/code/getting_started/app/views/comments/_comment.html.erb b/guides/code/getting_started/app/views/comments/_comment.html.erb
index 4c3fbf26cd..0cebe0bd96 100644
--- a/guides/code/getting_started/app/views/comments/_comment.html.erb
+++ b/guides/code/getting_started/app/views/comments/_comment.html.erb
@@ -1,13 +1,13 @@
+
<% end %>
-
-
<%= link_to 'Edit Post', edit_post_path(@post) %> |
-<%= link_to 'Back to Posts', posts_path %> |
+<%= link_to 'Back to Posts', posts_path %>
This will now render the partial in +app/views/comments/_comment.html.erb+ once
@@ -1496,50 +1487,38 @@ create a file +app/views/comments/_form.html.erb+ containing:
<%= form_for([@post, @post.comments.build]) do |f| %>
-
@@ -1594,7 +1594,6 @@ model, +app/models/post.rb+, as follows:
class Post < ActiveRecord::Base
- validates :name, :presence => true
validates :title, :presence => true,
:length => { :minimum => 5 }
has_many :comments, :dependent => :destroy
@@ -1623,11 +1622,8 @@ class PostsController < ApplicationController
http_basic_authenticate_with :name => "dhh", :password => "secret", :except => [:index, :show]
- # GET /posts
- # GET /posts.json
def index
@posts = Post.all
- respond_to do |format|
# snipped for brevity
@@ -1649,214 +1645,6 @@ Authentication challenge
!images/challenge.png(Basic HTTP Authentication Challenge)!
-h3. Building a Multi-Model Form
-
-Another feature of your average blog is the ability to tag posts. To implement
-this feature your application needs to interact with more than one model on a
-single form. Rails offers support for nested forms.
-
-To demonstrate this, we will add support for giving each post multiple tags,
-right in the form where you create the post. First, create a new model to hold
-the tags:
-
-
-$ rails generate model Tag name:string post:references
-
-
-Again, run the migration to create the database table:
-
-
-$ rake db:migrate
-
-
-Next, edit the +post.rb+ file to create the other side of the association, and
-to tell Rails (via the +accepts_nested_attributes_for+ macro) that you intend to
-edit tags via posts:
-
-
-class Post < ActiveRecord::Base
- validates :name, :presence => true
- validates :title, :presence => true,
- :length => { :minimum => 5 }
-
- has_many :comments, :dependent => :destroy
- has_many :tags
- attr_protected :tags
-
- accepts_nested_attributes_for :tags, :allow_destroy => :true,
- :reject_if => proc { |attrs| attrs.all? { |k, v| v.blank? } }
-end
-
-
-The +:allow_destroy+ option tells Rails to enable destroying tags through the
-nested attributes (you'll handle that by displaying a "remove" checkbox on the
-view that you'll build shortly). The +:reject_if+ option prevents saving new
-tags that do not have any attributes filled in.
-
-We will modify +views/posts/_form.html.erb+ to render a partial to make a tag:
-
-
-<% @post.tags.build %>
-<%= form_for(@post) do |post_form| %>
- <% if @post.errors.any? %>
-
-
<%= pluralize(@post.errors.count, "error") %> prohibited this post from being saved:
-
- <% @post.errors.full_messages.each do |msg| %>
-
-<% end %>
-
-
-Note that we have changed the +f+ in +form_for(@post) do |f|+ to +post_form+ to
-make it easier to understand what is going on.
-
-This example shows another option of the render helper, being able to pass in
-local variables, in this case, we want the local variable +form+ in the partial
-to refer to the +post_form+ object.
-
-We also add a @post.tags.build at the top of this form. This is to make
-sure there is a new tag ready to have its name filled in by the user. If you do
-not build the new tag, then the form will not appear as there is no new Tag
-object ready to create.
-
-Now create the folder app/views/tags and make a file in there called
-_form.html.erb which contains the form for the tag:
-
-
-<%= form.fields_for :tags do |tag_form| %>
-
-<%= render "comments/form" %>
-
-
-<%= link_to 'Edit Post', edit_post_path(@post) %> |
-<%= link_to 'Back to Posts', posts_path %> |
-
-
-With these changes in place, you'll find that you can edit a post and its tags
-directly on the same view.
-
-However, that method call @post.tags.map { |t| t.name }.join(", ") is
-awkward, we could handle this by making a helper method.
-
-h3. View Helpers
-
-View Helpers live in app/helpers and provide small snippets of reusable
-code for views. In our case, we want a method that strings a bunch of objects
-together using their name attribute and joining them with a comma. As this is
-for the Post show template, we put it in the PostsHelper.
-
-Open up app/helpers/posts_helper.rb and add the following:
-
-
-module PostsHelper
- def join_tags(post)
- post.tags.map { |t| t.name }.join(", ")
- end
-end
-
-
-Now you can edit the view in app/views/posts/show.html.erb to look like
-this:
-
-
-
<%= notice %>
-
-
- Name:
- <%= @post.name %>
-
-
-
- Title:
- <%= @post.title %>
-
-
-
- Content:
- <%= @post.content %>
-
-
-
- Tags:
- <%= join_tags(@post) %>
-
-
-
Comments
-<%= render @post.comments %>
-
-
Add a comment:
-<%= render "comments/form" %>
-
-
-<%= link_to 'Edit Post', edit_post_path(@post) %> |
-<%= link_to 'Back to Posts', posts_path %> |
-
-
h3. What's Next?
Now that you've seen your first Rails application, you should feel free to
From b7394646af80cd632b1b4c48feb57f5f48ed160a Mon Sep 17 00:00:00 2001
From: Oscar Del Ben
Date: Wed, 2 May 2012 12:34:35 +0200
Subject: [PATCH 13/20] Mention mac os x installation tools on getting started
guide
---
guides/source/getting_started.textile | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/guides/source/getting_started.textile b/guides/source/getting_started.textile
index 1fbbd8af67..59c7a167fb 100644
--- a/guides/source/getting_started.textile
+++ b/guides/source/getting_started.textile
@@ -87,7 +87,10 @@ To install Rails, use the +gem install+ command provided by RubyGems:
# gem install rails
-TIP. If you're working on Windows, you can quickly install Ruby and Rails with "Rails Installer":http://railsinstaller.org.
+TIP. A number of tools exist to help you quickly install Ruby and Ruby
+on Rails on your system. Windows users can use "Rails
+Installer":http://railsinstaller.org, while Mac Os X users can use
+"Rails One Click":http://railsoneclick.com.
To verify that you have everything installed correctly, you should be able to run the following:
From 31500f7284515604891a74d9853f691e67c76261 Mon Sep 17 00:00:00 2001
From: Oscar Del Ben
Date: Wed, 2 May 2012 13:44:08 +0300
Subject: [PATCH 14/20] Typo
---
guides/source/getting_started.textile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/guides/source/getting_started.textile b/guides/source/getting_started.textile
index 59c7a167fb..31eb332c89 100644
--- a/guides/source/getting_started.textile
+++ b/guides/source/getting_started.textile
@@ -89,7 +89,7 @@ To install Rails, use the +gem install+ command provided by RubyGems:
TIP. A number of tools exist to help you quickly install Ruby and Ruby
on Rails on your system. Windows users can use "Rails
-Installer":http://railsinstaller.org, while Mac Os X users can use
+Installer":http://railsinstaller.org, while Mac OS X users can use
"Rails One Click":http://railsoneclick.com.
To verify that you have everything installed correctly, you should be able to run the following:
From ce9e2534bfe68a1e14b686632cf848909558c098 Mon Sep 17 00:00:00 2001
From: Anuj Dutta
Date: Thu, 3 May 2012 00:56:28 +0000
Subject: [PATCH 15/20] Corrected the name of the module that should be
included to get the url helpers.
---
actionpack/lib/action_dispatch/routing/url_for.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/actionpack/lib/action_dispatch/routing/url_for.rb b/actionpack/lib/action_dispatch/routing/url_for.rb
index d75bb1c2de..ee02f4b531 100644
--- a/actionpack/lib/action_dispatch/routing/url_for.rb
+++ b/actionpack/lib/action_dispatch/routing/url_for.rb
@@ -68,7 +68,7 @@ module ActionDispatch
# This generates, among other things, the method users_path. By default,
# this method is accessible from your controllers, views and mailers. If you need
# to access this auto-generated method from other places (such as a model), then
- # you can do that by including ActionController::UrlFor in your class:
+ # you can do that by including Rails.application.routes.url_helpers in your class:
#
# class User < ActiveRecord::Base
# include Rails.application.routes.url_helpers
From c9e809c8e49ed9af43044554ad1698aa07748851 Mon Sep 17 00:00:00 2001
From: Paul McMahon
Date: Thu, 3 May 2012 17:20:59 +0900
Subject: [PATCH 16/20] I found it strange that this guide is redirecting
questions to a specific person. Heiko Webers' (@hawe) last blog post is a
year and a half old, so it's not obvious that he's still active with Rails
security. If he is, feel free to revert.
---
guides/source/security.textile | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/guides/source/security.textile b/guides/source/security.textile
index c065529cac..ac64b82bf6 100644
--- a/guides/source/security.textile
+++ b/guides/source/security.textile
@@ -1,7 +1,6 @@
h2. Ruby On Rails Security Guide
-This manual describes common security problems in web applications and how to avoid them with Rails. If you have any questions or suggestions, please
-mail me, Heiko Webers, at 42 {_et_} rorsecurity.info. After reading it, you should be familiar with:
+This manual describes common security problems in web applications and how to avoid them with Rails. After reading it, you should be familiar with:
* All countermeasures _(highlight)that are highlighted_
* The concept of sessions in Rails, what to put in there and popular attack methods
From e608588d3a8dce80d62d78d88d6dea4008bf0d37 Mon Sep 17 00:00:00 2001
From: Oscar Del Ben
Date: Thu, 3 May 2012 13:58:19 +0200
Subject: [PATCH 17/20] Update command line guide
---
guides/source/command_line.textile | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/guides/source/command_line.textile b/guides/source/command_line.textile
index 95a01710b5..71386f427a 100644
--- a/guides/source/command_line.textile
+++ b/guides/source/command_line.textile
@@ -12,7 +12,7 @@ endprologue.
NOTE: This tutorial assumes you have basic Rails knowledge from reading the "Getting Started with Rails Guide":getting_started.html.
-WARNING. This Guide is based on Rails 3.0. Some of the code shown here will not work in earlier versions of Rails.
+WARNING. This Guide is based on Rails 3.2. Some of the code shown here will not work in earlier versions of Rails.
h3. Command Line Basics
@@ -31,7 +31,7 @@ h4. +rails new+
The first thing we'll want to do is create a new Rails application by running the +rails new+ command after installing Rails.
-WARNING: You can install the rails gem by typing +gem install rails+, if you don't have it already. Follow the instructions in the "Rails 3 Release Notes":/3_0_release_notes.html
+TIP: You can install the rails gem by typing +gem install rails+, if you don't have it already.
$ rails new commandsapp
@@ -185,8 +185,6 @@ $ rails server
=> Booting WEBrick...
-WARNING: Make sure that you do not have any "tilde backup" files in +app/views/(controller)+, or else WEBrick will _not_ show the expected output. This seems to be a *bug* in Rails 2.3.0.
-
The URL will be "http://localhost:3000/greetings/hello":http://localhost:3000/greetings/hello.
INFO: With a normal, plain-old Rails application, your URLs will generally follow the pattern of http://(host)/(controller)/(action), and a URL like http://(host)/(controller) will hit the *index* action of that controller.
From 026e0d1c4df68c3471a93b0f9d90a581d1511bd1 Mon Sep 17 00:00:00 2001
From: Carlos Antonio da Silva
Date: Thu, 3 May 2012 22:16:04 -0300
Subject: [PATCH 18/20] Remove vestiges of the http_only! config from
configuring guide
---
guides/source/configuring.textile | 8 --------
1 file changed, 8 deletions(-)
diff --git a/guides/source/configuring.textile b/guides/source/configuring.textile
index 68426221bf..f17912e63c 100644
--- a/guides/source/configuring.textile
+++ b/guides/source/configuring.textile
@@ -248,14 +248,6 @@ They can also be removed from the stack completely:
config.middleware.delete ActionDispatch::BestStandardsSupport
-In addition to these methods to handle the stack, if your application is going to be used as an API endpoint only, the middleware stack can be configured like this:
-
-
-config.middleware.http_only!
-
-
-By doing this, Rails will create a smaller middleware stack, by not adding some middlewares that are usually useful for browser access only, such as Cookies, Session and Flash, BestStandardsSupport, and MethodOverride. You can always add any of them later manually if you want. Refer to the "API App docs":api_app.html for more info on how to setup your application for API only apps.
-
h4. Configuring i18n
* +config.i18n.default_locale+ sets the default locale of an application used for i18n. Defaults to +:en+.
From c058a773b89b1bf4103f9bd4910743f60f238792 Mon Sep 17 00:00:00 2001
From: Oscar Del Ben
Date: Fri, 4 May 2012 08:36:30 +0200
Subject: [PATCH 19/20] mention database mapping in getting started guide
---
guides/source/getting_started.textile | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/guides/source/getting_started.textile b/guides/source/getting_started.textile
index 31eb332c89..947abd7ba0 100644
--- a/guides/source/getting_started.textile
+++ b/guides/source/getting_started.textile
@@ -404,7 +404,10 @@ $ rails generate model Post title:string text:text
With that command we told Rails that we want a +Post+ model, which in
turn should have a title attribute of type string, and a text attribute
-of type text. Rails in turn responded by creating a bunch of files. For
+of type text. Those attributes are automatically added to the +posts+
+table in the database and mapped to the +Post+ model.
+
+Rails in turn responded by creating a bunch of files. For
now, we're only interested in +app/models/post.rb+ and
+db/migrate/20120419084633_create_posts.rb+. The latter is responsible
for creating the database structure, which is what we'll look at next.
From 616de66c55b58479e7da4271a0c990529395440e Mon Sep 17 00:00:00 2001
From: Alexey Vakhov
Date: Fri, 4 May 2012 12:32:35 +0400
Subject: [PATCH 20/20] Fix ActiveModel README example
---
activemodel/README.rdoc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/activemodel/README.rdoc b/activemodel/README.rdoc
index 9b05384792..1fd75141f8 100644
--- a/activemodel/README.rdoc
+++ b/activemodel/README.rdoc
@@ -25,7 +25,7 @@ to integrate with Action Pack out of the box: ActiveModel::Model.
person = Person.new(:name => 'bob', :age => '18')
person.name # => 'bob'
- person.age # => 18
+ person.age # => '18'
person.valid? # => true
It includes model name introspections, conversions, translations and