aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-04-04 13:36:15 -0700
committerXavier Noria <fxn@hashref.com>2010-04-04 13:36:15 -0700
commit723e91e9fd594856aa7bcd38b04d04acd03039be (patch)
treec35f6fa19af20a64643249115732ba185db8bdc3
parentb546945b51d1e5765b4bf4eba0bd8413ea8e4198 (diff)
parent00884a59013a658082dab41da5ff41add31b8c43 (diff)
downloadrails-723e91e9fd594856aa7bcd38b04d04acd03039be.tar.gz
rails-723e91e9fd594856aa7bcd38b04d04acd03039be.tar.bz2
rails-723e91e9fd594856aa7bcd38b04d04acd03039be.zip
Merge commit 'docrails/master'
-rw-r--r--actionpack/lib/action_controller/record_identifier.rb2
-rw-r--r--actionpack/lib/action_dispatch/routing/url_for.rb2
-rw-r--r--actionpack/lib/action_view/helpers/atom_feed_helper.rb4
-rw-r--r--actionpack/lib/action_view/helpers/form_helper.rb26
-rwxr-xr-xactiverecord/lib/active_record/base.rb2
-rw-r--r--railties/guides/assets/images/belongs_to.png (renamed from railties/guides/images/belongs_to.png)bin34017 -> 34017 bytes
-rw-r--r--railties/guides/assets/images/book_icon.gif (renamed from railties/guides/images/book_icon.gif)bin337 -> 337 bytes
-rw-r--r--railties/guides/assets/images/bullet.gif (renamed from railties/guides/images/bullet.gif)bin60 -> 60 bytes
-rw-r--r--railties/guides/assets/images/challenge.png (renamed from railties/guides/images/challenge.png)bin54134 -> 54134 bytes
-rw-r--r--railties/guides/assets/images/chapters_icon.gif (renamed from railties/guides/images/chapters_icon.gif)bin628 -> 628 bytes
-rw-r--r--railties/guides/assets/images/check_bullet.gif (renamed from railties/guides/images/check_bullet.gif)bin384 -> 384 bytes
-rw-r--r--railties/guides/assets/images/credits_pic_blank.gif (renamed from railties/guides/images/credits_pic_blank.gif)bin613 -> 613 bytes
-rw-r--r--railties/guides/assets/images/csrf.png (renamed from railties/guides/images/csrf.png)bin41996 -> 41996 bytes
-rw-r--r--railties/guides/assets/images/customized_error_messages.png (renamed from railties/guides/images/customized_error_messages.png)bin5055 -> 5055 bytes
-rw-r--r--railties/guides/assets/images/edge_badge.png (renamed from railties/guides/images/edge_badge.png)bin7945 -> 7945 bytes
-rw-r--r--railties/guides/assets/images/error_messages.png (renamed from railties/guides/images/error_messages.png)bin14645 -> 14645 bytes
-rw-r--r--railties/guides/assets/images/feature_tile.gif (renamed from railties/guides/images/feature_tile.gif)bin43 -> 43 bytes
-rw-r--r--railties/guides/assets/images/footer_tile.gif (renamed from railties/guides/images/footer_tile.gif)bin44 -> 44 bytes
-rw-r--r--railties/guides/assets/images/fxn.png (renamed from railties/guides/images/fxn.png)bin20664 -> 20664 bytes
-rw-r--r--railties/guides/assets/images/grey_bullet.gif (renamed from railties/guides/images/grey_bullet.gif)bin45 -> 45 bytes
-rw-r--r--railties/guides/assets/images/habtm.png (renamed from railties/guides/images/habtm.png)bin63801 -> 63801 bytes
-rw-r--r--railties/guides/assets/images/has_many.png (renamed from railties/guides/images/has_many.png)bin38582 -> 38582 bytes
-rw-r--r--railties/guides/assets/images/has_many_through.png (renamed from railties/guides/images/has_many_through.png)bin100220 -> 100220 bytes
-rw-r--r--railties/guides/assets/images/has_one.png (renamed from railties/guides/images/has_one.png)bin39022 -> 39022 bytes
-rw-r--r--railties/guides/assets/images/has_one_through.png (renamed from railties/guides/images/has_one_through.png)bin92594 -> 92594 bytes
-rw-r--r--railties/guides/assets/images/header_backdrop.png (renamed from railties/guides/images/header_backdrop.png)bin882 -> 882 bytes
-rw-r--r--railties/guides/assets/images/header_tile.gif (renamed from railties/guides/images/header_tile.gif)bin44 -> 44 bytes
-rw-r--r--railties/guides/assets/images/i18n/demo_localized_pirate.png (renamed from railties/guides/images/i18n/demo_localized_pirate.png)bin15027 -> 15027 bytes
-rw-r--r--railties/guides/assets/images/i18n/demo_translated_en.png (renamed from railties/guides/images/i18n/demo_translated_en.png)bin12057 -> 12057 bytes
-rw-r--r--railties/guides/assets/images/i18n/demo_translated_pirate.png (renamed from railties/guides/images/i18n/demo_translated_pirate.png)bin13392 -> 13392 bytes
-rw-r--r--railties/guides/assets/images/i18n/demo_translation_missing.png (renamed from railties/guides/images/i18n/demo_translation_missing.png)bin13143 -> 13143 bytes
-rw-r--r--railties/guides/assets/images/i18n/demo_untranslated.png (renamed from railties/guides/images/i18n/demo_untranslated.png)bin11925 -> 11925 bytes
-rw-r--r--railties/guides/assets/images/icons/README (renamed from railties/guides/images/icons/README)0
-rw-r--r--railties/guides/assets/images/icons/callouts/1.png (renamed from railties/guides/images/icons/callouts/1.png)bin329 -> 329 bytes
-rw-r--r--railties/guides/assets/images/icons/callouts/10.png (renamed from railties/guides/images/icons/callouts/10.png)bin361 -> 361 bytes
-rw-r--r--railties/guides/assets/images/icons/callouts/11.png (renamed from railties/guides/images/icons/callouts/11.png)bin565 -> 565 bytes
-rw-r--r--railties/guides/assets/images/icons/callouts/12.png (renamed from railties/guides/images/icons/callouts/12.png)bin617 -> 617 bytes
-rw-r--r--railties/guides/assets/images/icons/callouts/13.png (renamed from railties/guides/images/icons/callouts/13.png)bin623 -> 623 bytes
-rw-r--r--railties/guides/assets/images/icons/callouts/14.png (renamed from railties/guides/images/icons/callouts/14.png)bin411 -> 411 bytes
-rw-r--r--railties/guides/assets/images/icons/callouts/15.png (renamed from railties/guides/images/icons/callouts/15.png)bin640 -> 640 bytes
-rw-r--r--railties/guides/assets/images/icons/callouts/2.png (renamed from railties/guides/images/icons/callouts/2.png)bin353 -> 353 bytes
-rw-r--r--railties/guides/assets/images/icons/callouts/3.png (renamed from railties/guides/images/icons/callouts/3.png)bin350 -> 350 bytes
-rw-r--r--railties/guides/assets/images/icons/callouts/4.png (renamed from railties/guides/images/icons/callouts/4.png)bin345 -> 345 bytes
-rw-r--r--railties/guides/assets/images/icons/callouts/5.png (renamed from railties/guides/images/icons/callouts/5.png)bin348 -> 348 bytes
-rw-r--r--railties/guides/assets/images/icons/callouts/6.png (renamed from railties/guides/images/icons/callouts/6.png)bin355 -> 355 bytes
-rw-r--r--railties/guides/assets/images/icons/callouts/7.png (renamed from railties/guides/images/icons/callouts/7.png)bin344 -> 344 bytes
-rw-r--r--railties/guides/assets/images/icons/callouts/8.png (renamed from railties/guides/images/icons/callouts/8.png)bin357 -> 357 bytes
-rw-r--r--railties/guides/assets/images/icons/callouts/9.png (renamed from railties/guides/images/icons/callouts/9.png)bin357 -> 357 bytes
-rw-r--r--railties/guides/assets/images/icons/caution.png (renamed from railties/guides/images/icons/caution.png)bin2554 -> 2554 bytes
-rw-r--r--railties/guides/assets/images/icons/example.png (renamed from railties/guides/images/icons/example.png)bin2354 -> 2354 bytes
-rw-r--r--railties/guides/assets/images/icons/home.png (renamed from railties/guides/images/icons/home.png)bin1340 -> 1340 bytes
-rw-r--r--railties/guides/assets/images/icons/important.png (renamed from railties/guides/images/icons/important.png)bin2657 -> 2657 bytes
-rw-r--r--railties/guides/assets/images/icons/next.png (renamed from railties/guides/images/icons/next.png)bin1302 -> 1302 bytes
-rw-r--r--railties/guides/assets/images/icons/note.png (renamed from railties/guides/images/icons/note.png)bin2730 -> 2730 bytes
-rw-r--r--railties/guides/assets/images/icons/prev.png (renamed from railties/guides/images/icons/prev.png)bin1348 -> 1348 bytes
-rw-r--r--railties/guides/assets/images/icons/tip.png (renamed from railties/guides/images/icons/tip.png)bin2602 -> 2602 bytes
-rw-r--r--railties/guides/assets/images/icons/up.png (renamed from railties/guides/images/icons/up.png)bin1320 -> 1320 bytes
-rw-r--r--railties/guides/assets/images/icons/warning.png (renamed from railties/guides/images/icons/warning.png)bin2828 -> 2828 bytes
-rw-r--r--railties/guides/assets/images/jaimeiniesta.jpgbin0 -> 11913 bytes
-rw-r--r--railties/guides/assets/images/nav_arrow.gif (renamed from railties/guides/images/nav_arrow.gif)bin427 -> 427 bytes
-rw-r--r--railties/guides/assets/images/polymorphic.png (renamed from railties/guides/images/polymorphic.png)bin85248 -> 85248 bytes
-rw-r--r--railties/guides/assets/images/posts_index.png (renamed from railties/guides/images/posts_index.png)bin60846 -> 60846 bytes
-rw-r--r--railties/guides/assets/images/rails_guides_logo.gif (renamed from railties/guides/images/rails_guides_logo.gif)bin5114 -> 5114 bytes
-rw-r--r--railties/guides/assets/images/rails_logo_remix.gif (renamed from railties/guides/images/rails_logo_remix.gif)bin8533 -> 8533 bytes
-rw-r--r--railties/guides/assets/images/rails_welcome.png (renamed from railties/guides/images/rails_welcome.png)bin106417 -> 106417 bytes
-rw-r--r--railties/guides/assets/images/session_fixation.png (renamed from railties/guides/images/session_fixation.png)bin47860 -> 47860 bytes
-rw-r--r--railties/guides/assets/images/tab_grey.gif (renamed from railties/guides/images/tab_grey.gif)bin4924 -> 4924 bytes
-rw-r--r--railties/guides/assets/images/tab_info.gif (renamed from railties/guides/images/tab_info.gif)bin4762 -> 4762 bytes
-rw-r--r--railties/guides/assets/images/tab_note.gif (renamed from railties/guides/images/tab_note.gif)bin4807 -> 4807 bytes
-rw-r--r--railties/guides/assets/images/tab_red.gif (renamed from railties/guides/images/tab_red.gif)bin4753 -> 4753 bytes
-rw-r--r--railties/guides/assets/images/tab_yellow.gif (renamed from railties/guides/images/tab_yellow.gif)bin4759 -> 4759 bytes
-rw-r--r--railties/guides/assets/images/tab_yellow.png (renamed from railties/guides/images/tab_yellow.png)bin1611 -> 1611 bytes
-rw-r--r--railties/guides/assets/images/validation_error_messages.png (renamed from railties/guides/images/validation_error_messages.png)bin1107 -> 1107 bytes
-rwxr-xr-xrailties/guides/assets/javascripts/code_highlighter.js (renamed from railties/guides/files/javascripts/code_highlighter.js)0
-rwxr-xr-xrailties/guides/assets/javascripts/guides.js (renamed from railties/guides/files/javascripts/guides.js)0
-rw-r--r--railties/guides/assets/javascripts/highlighters.js (renamed from railties/guides/files/javascripts/highlighters.js)0
-rw-r--r--railties/guides/assets/stylesheets/main.css (renamed from railties/guides/files/stylesheets/main.css)28
-rwxr-xr-xrailties/guides/assets/stylesheets/print.css (renamed from railties/guides/files/stylesheets/print.css)0
-rwxr-xr-xrailties/guides/assets/stylesheets/reset.css (renamed from railties/guides/files/stylesheets/reset.css)0
-rwxr-xr-xrailties/guides/assets/stylesheets/style.css (renamed from railties/guides/files/stylesheets/style.css)0
-rw-r--r--railties/guides/assets/stylesheets/syntax.css (renamed from railties/guides/files/stylesheets/syntax.css)0
-rw-r--r--railties/guides/rails_guides/generator.rb50
-rw-r--r--railties/guides/source/action_view_overview.textile2
-rw-r--r--railties/guides/source/active_support_core_extensions.textile6
-rw-r--r--railties/guides/source/contribute.textile2
-rw-r--r--railties/guides/source/credits.html.erb30
-rw-r--r--railties/guides/source/debugging_rails_applications.textile3
-rw-r--r--railties/guides/source/form_helpers.textile2
-rw-r--r--railties/guides/source/getting_started.textile1
-rw-r--r--railties/guides/source/layout.html.erb12
-rw-r--r--railties/guides/source/layouts_and_rendering.textile5
-rw-r--r--railties/guides/source/performance_testing.textile8
-rw-r--r--railties/guides/source/plugins.textile29
-rw-r--r--railties/guides/source/routing.textile6
-rw-r--r--railties/guides/source/security.textile10
-rw-r--r--railties/guides/source/testing.textile3
96 files changed, 121 insertions, 112 deletions
diff --git a/actionpack/lib/action_controller/record_identifier.rb b/actionpack/lib/action_controller/record_identifier.rb
index 7fdaffe3eb..fe2f6cee70 100644
--- a/actionpack/lib/action_controller/record_identifier.rb
+++ b/actionpack/lib/action_controller/record_identifier.rb
@@ -6,7 +6,7 @@ module ActionController
# the view actions to a higher logical level. Example:
#
# # routes
- # map.resources :posts
+ # resources :posts
#
# # view
# <% div_for(post) do %> <div id="post_45" class="post">
diff --git a/actionpack/lib/action_dispatch/routing/url_for.rb b/actionpack/lib/action_dispatch/routing/url_for.rb
index dd86aa3e87..fb236dce53 100644
--- a/actionpack/lib/action_dispatch/routing/url_for.rb
+++ b/actionpack/lib/action_dispatch/routing/url_for.rb
@@ -63,7 +63,7 @@ module ActionDispatch
# named routes. For example, suppose that you have a 'users' resource in your
# <b>routes.rb</b>:
#
- # map.resources :users
+ # resources :users
#
# This generates, among other things, the method <tt>users_path</tt>. By default,
# this method is accessible from your controllers, views and mailers. If you need
diff --git a/actionpack/lib/action_view/helpers/atom_feed_helper.rb b/actionpack/lib/action_view/helpers/atom_feed_helper.rb
index 58c3a8752e..52806f206a 100644
--- a/actionpack/lib/action_view/helpers/atom_feed_helper.rb
+++ b/actionpack/lib/action_view/helpers/atom_feed_helper.rb
@@ -9,8 +9,8 @@ module ActionView
#
# config/routes.rb:
# Basecamp::Application.routes.draw do |map|
- # map.resources :posts
- # map.root :controller => "posts"
+ # resources :posts
+ # root :to => "posts#index"
# end
#
# app/controllers/posts_controller.rb:
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb
index 6a14f0be9c..9467a0912a 100644
--- a/actionpack/lib/action_view/helpers/form_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_helper.rb
@@ -121,7 +121,7 @@ module ActionView
# The generic way to call +form_for+ yields a form builder around a
# model:
#
- # <%= form_for :person, :url => { :action => "update" } do |f| %>
+ # <%= form_for :person, :url => { :action => "create" } do |f| %>
# <%= f.error_messages %>
# First name: <%= f.text_field :first_name %><br />
# Last name : <%= f.text_field :last_name %><br />
@@ -145,7 +145,7 @@ module ActionView
# If the instance variable is not <tt>@person</tt> you can pass the actual
# record as the second argument:
#
- # <%= form_for :person, person, :url => { :action => "update" } do |f| %>
+ # <%= form_for :person, person, :url => { :action => "create" } do |f| %>
# ...
# <% end %>
#
@@ -177,7 +177,7 @@ module ActionView
# possible to use both the stand-alone FormHelper methods and methods
# from FormTagHelper. For example:
#
- # <%= form_for :person, @person, :url => { :action => "update" } do |f| %>
+ # <%= form_for :person, @person, :url => { :action => "create" } do |f| %>
# First name: <%= f.text_field :first_name %>
# Last name : <%= f.text_field :last_name %>
# Biography : <%= text_area :person, :biography %>
@@ -265,7 +265,7 @@ module ActionView
# custom builder. For example, let's say you made a helper to
# automatically add labels to form inputs.
#
- # <%= form_for :person, @person, :url => { :action => "update" }, :builder => LabellingFormBuilder do |f| %>
+ # <%= form_for :person, @person, :url => { :action => "create" }, :builder => LabellingFormBuilder do |f| %>
# <%= f.text_field :first_name %>
# <%= f.text_field :last_name %>
# <%= text_area :person, :biography %>
@@ -342,7 +342,7 @@ module ActionView
#
# === Generic Examples
#
- # <%= form_for @person, :url => { :action => "update" } do |person_form| %>
+ # <%= form_for @person do |person_form| %>
# First name: <%= person_form.text_field :first_name %>
# Last name : <%= person_form.text_field :last_name %>
#
@@ -354,13 +354,13 @@ module ActionView
# ...or if you have an object that needs to be represented as a different
# parameter, like a Client that acts as a Person:
#
- # <%= fields_for :person, @client do |permission_fields| %>
+ # <%= fields_for :person, @client, :url => { :action => "create" } do |permission_fields| %>
# Admin?: <%= permission_fields.check_box :admin %>
# <% end %>
#
# ...or if you don't have an object, just a name of the parameter:
#
- # <%= fields_for :person do |permission_fields| %>
+ # <%= fields_for :person, :url => { :action => "create" } do |permission_fields| %>
# Admin?: <%= permission_fields.check_box :admin %>
# <% end %>
#
@@ -404,7 +404,7 @@ module ActionView
#
# This model can now be used with a nested fields_for, like so:
#
- # <%= form_for @person, :url => { :action => "update" } do |person_form| %>
+ # <%= form_for @person do |person_form| %>
# ...
# <%= person_form.fields_for :address do |address_fields| %>
# Street : <%= address_fields.text_field :street %>
@@ -433,7 +433,7 @@ module ActionView
# with a value that evaluates to +true+, you will destroy the associated
# model (eg. 1, '1', true, or 'true'):
#
- # <%= form_for @person, :url => { :action => "update" } do |person_form| %>
+ # <%= form_for @person do |person_form| %>
# ...
# <%= person_form.fields_for :address do |address_fields| %>
# ...
@@ -461,7 +461,7 @@ module ActionView
# the nested fields_for call will be repeated for each instance in the
# collection:
#
- # <%= form_for @person, :url => { :action => "update" } do |person_form| %>
+ # <%= form_for @person do |person_form| %>
# ...
# <%= person_form.fields_for :projects do |project_fields| %>
# <% if project_fields.object.active? %>
@@ -472,7 +472,7 @@ module ActionView
#
# It's also possible to specify the instance to be used:
#
- # <%= form_for @person, :url => { :action => "update" } do |person_form| %>
+ # <%= form_for @person do |person_form| %>
# ...
# <% @person.projects.each do |project| %>
# <% if project.active? %>
@@ -485,7 +485,7 @@ module ActionView
#
# Or a collection to be used:
#
- # <%= form_for @person, :url => { :action => "update" } do |person_form| %>
+ # <%= form_for @person do |person_form| %>
# ...
# <%= person_form.fields_for :projects, @active_projects do |project_fields| %>
# Name: <%= project_fields.text_field :name %>
@@ -514,7 +514,7 @@ module ActionView
# parameter with a value that evaluates to +true+
# (eg. 1, '1', true, or 'true'):
#
- # <%= form_for @person, :url => { :action => "update" } do |person_form| %>
+ # <%= form_for @person do |person_form| %>
# ...
# <%= person_form.fields_for :projects do |project_fields| %>
# Delete: <%= project_fields.check_box :_destroy %>
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 37b379af9e..5f741c6ae7 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -1572,7 +1572,7 @@ module ActiveRecord #:nodoc:
# or nil if this record's unsaved.
#
# For example, suppose that you have a User model, and that you have a
- # <tt>map.resources :users</tt> route. Normally, +user_path+ will
+ # <tt>resources :users</tt> route. Normally, +user_path+ will
# construct a path with the user object's 'id' in it:
#
# user = User.find_by_name('Phusion')
diff --git a/railties/guides/images/belongs_to.png b/railties/guides/assets/images/belongs_to.png
index 44243edbca..44243edbca 100644
--- a/railties/guides/images/belongs_to.png
+++ b/railties/guides/assets/images/belongs_to.png
Binary files differ
diff --git a/railties/guides/images/book_icon.gif b/railties/guides/assets/images/book_icon.gif
index c81d5db520..c81d5db520 100644
--- a/railties/guides/images/book_icon.gif
+++ b/railties/guides/assets/images/book_icon.gif
Binary files differ
diff --git a/railties/guides/images/bullet.gif b/railties/guides/assets/images/bullet.gif
index 95a26364a4..95a26364a4 100644
--- a/railties/guides/images/bullet.gif
+++ b/railties/guides/assets/images/bullet.gif
Binary files differ
diff --git a/railties/guides/images/challenge.png b/railties/guides/assets/images/challenge.png
index d163748640..d163748640 100644
--- a/railties/guides/images/challenge.png
+++ b/railties/guides/assets/images/challenge.png
Binary files differ
diff --git a/railties/guides/images/chapters_icon.gif b/railties/guides/assets/images/chapters_icon.gif
index 06fb415f4a..06fb415f4a 100644
--- a/railties/guides/images/chapters_icon.gif
+++ b/railties/guides/assets/images/chapters_icon.gif
Binary files differ
diff --git a/railties/guides/images/check_bullet.gif b/railties/guides/assets/images/check_bullet.gif
index 1fcfeba250..1fcfeba250 100644
--- a/railties/guides/images/check_bullet.gif
+++ b/railties/guides/assets/images/check_bullet.gif
Binary files differ
diff --git a/railties/guides/images/credits_pic_blank.gif b/railties/guides/assets/images/credits_pic_blank.gif
index f6f654fc65..f6f654fc65 100644
--- a/railties/guides/images/credits_pic_blank.gif
+++ b/railties/guides/assets/images/credits_pic_blank.gif
Binary files differ
diff --git a/railties/guides/images/csrf.png b/railties/guides/assets/images/csrf.png
index ab73baafe8..ab73baafe8 100644
--- a/railties/guides/images/csrf.png
+++ b/railties/guides/assets/images/csrf.png
Binary files differ
diff --git a/railties/guides/images/customized_error_messages.png b/railties/guides/assets/images/customized_error_messages.png
index fa676991e3..fa676991e3 100644
--- a/railties/guides/images/customized_error_messages.png
+++ b/railties/guides/assets/images/customized_error_messages.png
Binary files differ
diff --git a/railties/guides/images/edge_badge.png b/railties/guides/assets/images/edge_badge.png
index cddd46c4b8..cddd46c4b8 100644
--- a/railties/guides/images/edge_badge.png
+++ b/railties/guides/assets/images/edge_badge.png
Binary files differ
diff --git a/railties/guides/images/error_messages.png b/railties/guides/assets/images/error_messages.png
index 428892194a..428892194a 100644
--- a/railties/guides/images/error_messages.png
+++ b/railties/guides/assets/images/error_messages.png
Binary files differ
diff --git a/railties/guides/images/feature_tile.gif b/railties/guides/assets/images/feature_tile.gif
index 75469361db..75469361db 100644
--- a/railties/guides/images/feature_tile.gif
+++ b/railties/guides/assets/images/feature_tile.gif
Binary files differ
diff --git a/railties/guides/images/footer_tile.gif b/railties/guides/assets/images/footer_tile.gif
index bb33fc1ff0..bb33fc1ff0 100644
--- a/railties/guides/images/footer_tile.gif
+++ b/railties/guides/assets/images/footer_tile.gif
Binary files differ
diff --git a/railties/guides/images/fxn.png b/railties/guides/assets/images/fxn.png
index 9b531ee584..9b531ee584 100644
--- a/railties/guides/images/fxn.png
+++ b/railties/guides/assets/images/fxn.png
Binary files differ
diff --git a/railties/guides/images/grey_bullet.gif b/railties/guides/assets/images/grey_bullet.gif
index e75e8e93a1..e75e8e93a1 100644
--- a/railties/guides/images/grey_bullet.gif
+++ b/railties/guides/assets/images/grey_bullet.gif
Binary files differ
diff --git a/railties/guides/images/habtm.png b/railties/guides/assets/images/habtm.png
index fea78b0b5c..fea78b0b5c 100644
--- a/railties/guides/images/habtm.png
+++ b/railties/guides/assets/images/habtm.png
Binary files differ
diff --git a/railties/guides/images/has_many.png b/railties/guides/assets/images/has_many.png
index 6cff58460d..6cff58460d 100644
--- a/railties/guides/images/has_many.png
+++ b/railties/guides/assets/images/has_many.png
Binary files differ
diff --git a/railties/guides/images/has_many_through.png b/railties/guides/assets/images/has_many_through.png
index 85d7599925..85d7599925 100644
--- a/railties/guides/images/has_many_through.png
+++ b/railties/guides/assets/images/has_many_through.png
Binary files differ
diff --git a/railties/guides/images/has_one.png b/railties/guides/assets/images/has_one.png
index a70ddaaa86..a70ddaaa86 100644
--- a/railties/guides/images/has_one.png
+++ b/railties/guides/assets/images/has_one.png
Binary files differ
diff --git a/railties/guides/images/has_one_through.png b/railties/guides/assets/images/has_one_through.png
index 89a7617a30..89a7617a30 100644
--- a/railties/guides/images/has_one_through.png
+++ b/railties/guides/assets/images/has_one_through.png
Binary files differ
diff --git a/railties/guides/images/header_backdrop.png b/railties/guides/assets/images/header_backdrop.png
index ff2982175e..ff2982175e 100644
--- a/railties/guides/images/header_backdrop.png
+++ b/railties/guides/assets/images/header_backdrop.png
Binary files differ
diff --git a/railties/guides/images/header_tile.gif b/railties/guides/assets/images/header_tile.gif
index e2c878d492..e2c878d492 100644
--- a/railties/guides/images/header_tile.gif
+++ b/railties/guides/assets/images/header_tile.gif
Binary files differ
diff --git a/railties/guides/images/i18n/demo_localized_pirate.png b/railties/guides/assets/images/i18n/demo_localized_pirate.png
index 9134709573..9134709573 100644
--- a/railties/guides/images/i18n/demo_localized_pirate.png
+++ b/railties/guides/assets/images/i18n/demo_localized_pirate.png
Binary files differ
diff --git a/railties/guides/images/i18n/demo_translated_en.png b/railties/guides/assets/images/i18n/demo_translated_en.png
index ecdd878d38..ecdd878d38 100644
--- a/railties/guides/images/i18n/demo_translated_en.png
+++ b/railties/guides/assets/images/i18n/demo_translated_en.png
Binary files differ
diff --git a/railties/guides/images/i18n/demo_translated_pirate.png b/railties/guides/assets/images/i18n/demo_translated_pirate.png
index 41c580923a..41c580923a 100644
--- a/railties/guides/images/i18n/demo_translated_pirate.png
+++ b/railties/guides/assets/images/i18n/demo_translated_pirate.png
Binary files differ
diff --git a/railties/guides/images/i18n/demo_translation_missing.png b/railties/guides/assets/images/i18n/demo_translation_missing.png
index af9e2d0427..af9e2d0427 100644
--- a/railties/guides/images/i18n/demo_translation_missing.png
+++ b/railties/guides/assets/images/i18n/demo_translation_missing.png
Binary files differ
diff --git a/railties/guides/images/i18n/demo_untranslated.png b/railties/guides/assets/images/i18n/demo_untranslated.png
index 3603f43463..3603f43463 100644
--- a/railties/guides/images/i18n/demo_untranslated.png
+++ b/railties/guides/assets/images/i18n/demo_untranslated.png
Binary files differ
diff --git a/railties/guides/images/icons/README b/railties/guides/assets/images/icons/README
index f12b2a730c..f12b2a730c 100644
--- a/railties/guides/images/icons/README
+++ b/railties/guides/assets/images/icons/README
diff --git a/railties/guides/images/icons/callouts/1.png b/railties/guides/assets/images/icons/callouts/1.png
index 7d473430b7..7d473430b7 100644
--- a/railties/guides/images/icons/callouts/1.png
+++ b/railties/guides/assets/images/icons/callouts/1.png
Binary files differ
diff --git a/railties/guides/images/icons/callouts/10.png b/railties/guides/assets/images/icons/callouts/10.png
index 997bbc8246..997bbc8246 100644
--- a/railties/guides/images/icons/callouts/10.png
+++ b/railties/guides/assets/images/icons/callouts/10.png
Binary files differ
diff --git a/railties/guides/images/icons/callouts/11.png b/railties/guides/assets/images/icons/callouts/11.png
index ce47dac3f5..ce47dac3f5 100644
--- a/railties/guides/images/icons/callouts/11.png
+++ b/railties/guides/assets/images/icons/callouts/11.png
Binary files differ
diff --git a/railties/guides/images/icons/callouts/12.png b/railties/guides/assets/images/icons/callouts/12.png
index 31daf4e2f2..31daf4e2f2 100644
--- a/railties/guides/images/icons/callouts/12.png
+++ b/railties/guides/assets/images/icons/callouts/12.png
Binary files differ
diff --git a/railties/guides/images/icons/callouts/13.png b/railties/guides/assets/images/icons/callouts/13.png
index 14021a89c2..14021a89c2 100644
--- a/railties/guides/images/icons/callouts/13.png
+++ b/railties/guides/assets/images/icons/callouts/13.png
Binary files differ
diff --git a/railties/guides/images/icons/callouts/14.png b/railties/guides/assets/images/icons/callouts/14.png
index 64014b75fe..64014b75fe 100644
--- a/railties/guides/images/icons/callouts/14.png
+++ b/railties/guides/assets/images/icons/callouts/14.png
Binary files differ
diff --git a/railties/guides/images/icons/callouts/15.png b/railties/guides/assets/images/icons/callouts/15.png
index 0d65765fcf..0d65765fcf 100644
--- a/railties/guides/images/icons/callouts/15.png
+++ b/railties/guides/assets/images/icons/callouts/15.png
Binary files differ
diff --git a/railties/guides/images/icons/callouts/2.png b/railties/guides/assets/images/icons/callouts/2.png
index 5d09341b2f..5d09341b2f 100644
--- a/railties/guides/images/icons/callouts/2.png
+++ b/railties/guides/assets/images/icons/callouts/2.png
Binary files differ
diff --git a/railties/guides/images/icons/callouts/3.png b/railties/guides/assets/images/icons/callouts/3.png
index ef7b700471..ef7b700471 100644
--- a/railties/guides/images/icons/callouts/3.png
+++ b/railties/guides/assets/images/icons/callouts/3.png
Binary files differ
diff --git a/railties/guides/images/icons/callouts/4.png b/railties/guides/assets/images/icons/callouts/4.png
index adb8364eb5..adb8364eb5 100644
--- a/railties/guides/images/icons/callouts/4.png
+++ b/railties/guides/assets/images/icons/callouts/4.png
Binary files differ
diff --git a/railties/guides/images/icons/callouts/5.png b/railties/guides/assets/images/icons/callouts/5.png
index 4d7eb46002..4d7eb46002 100644
--- a/railties/guides/images/icons/callouts/5.png
+++ b/railties/guides/assets/images/icons/callouts/5.png
Binary files differ
diff --git a/railties/guides/images/icons/callouts/6.png b/railties/guides/assets/images/icons/callouts/6.png
index 0ba694af6c..0ba694af6c 100644
--- a/railties/guides/images/icons/callouts/6.png
+++ b/railties/guides/assets/images/icons/callouts/6.png
Binary files differ
diff --git a/railties/guides/images/icons/callouts/7.png b/railties/guides/assets/images/icons/callouts/7.png
index 472e96f8ac..472e96f8ac 100644
--- a/railties/guides/images/icons/callouts/7.png
+++ b/railties/guides/assets/images/icons/callouts/7.png
Binary files differ
diff --git a/railties/guides/images/icons/callouts/8.png b/railties/guides/assets/images/icons/callouts/8.png
index 5e60973c21..5e60973c21 100644
--- a/railties/guides/images/icons/callouts/8.png
+++ b/railties/guides/assets/images/icons/callouts/8.png
Binary files differ
diff --git a/railties/guides/images/icons/callouts/9.png b/railties/guides/assets/images/icons/callouts/9.png
index a0676d26cc..a0676d26cc 100644
--- a/railties/guides/images/icons/callouts/9.png
+++ b/railties/guides/assets/images/icons/callouts/9.png
Binary files differ
diff --git a/railties/guides/images/icons/caution.png b/railties/guides/assets/images/icons/caution.png
index cb9d5ea0df..cb9d5ea0df 100644
--- a/railties/guides/images/icons/caution.png
+++ b/railties/guides/assets/images/icons/caution.png
Binary files differ
diff --git a/railties/guides/images/icons/example.png b/railties/guides/assets/images/icons/example.png
index bba1c0010d..bba1c0010d 100644
--- a/railties/guides/images/icons/example.png
+++ b/railties/guides/assets/images/icons/example.png
Binary files differ
diff --git a/railties/guides/images/icons/home.png b/railties/guides/assets/images/icons/home.png
index 37a5231bac..37a5231bac 100644
--- a/railties/guides/images/icons/home.png
+++ b/railties/guides/assets/images/icons/home.png
Binary files differ
diff --git a/railties/guides/images/icons/important.png b/railties/guides/assets/images/icons/important.png
index 1096c23295..1096c23295 100644
--- a/railties/guides/images/icons/important.png
+++ b/railties/guides/assets/images/icons/important.png
Binary files differ
diff --git a/railties/guides/images/icons/next.png b/railties/guides/assets/images/icons/next.png
index 64e126bdda..64e126bdda 100644
--- a/railties/guides/images/icons/next.png
+++ b/railties/guides/assets/images/icons/next.png
Binary files differ
diff --git a/railties/guides/images/icons/note.png b/railties/guides/assets/images/icons/note.png
index 841820f7c4..841820f7c4 100644
--- a/railties/guides/images/icons/note.png
+++ b/railties/guides/assets/images/icons/note.png
Binary files differ
diff --git a/railties/guides/images/icons/prev.png b/railties/guides/assets/images/icons/prev.png
index 3e8f12fe24..3e8f12fe24 100644
--- a/railties/guides/images/icons/prev.png
+++ b/railties/guides/assets/images/icons/prev.png
Binary files differ
diff --git a/railties/guides/images/icons/tip.png b/railties/guides/assets/images/icons/tip.png
index a3a029d898..a3a029d898 100644
--- a/railties/guides/images/icons/tip.png
+++ b/railties/guides/assets/images/icons/tip.png
Binary files differ
diff --git a/railties/guides/images/icons/up.png b/railties/guides/assets/images/icons/up.png
index 2db1ce62fa..2db1ce62fa 100644
--- a/railties/guides/images/icons/up.png
+++ b/railties/guides/assets/images/icons/up.png
Binary files differ
diff --git a/railties/guides/images/icons/warning.png b/railties/guides/assets/images/icons/warning.png
index 0b0c419df2..0b0c419df2 100644
--- a/railties/guides/images/icons/warning.png
+++ b/railties/guides/assets/images/icons/warning.png
Binary files differ
diff --git a/railties/guides/assets/images/jaimeiniesta.jpg b/railties/guides/assets/images/jaimeiniesta.jpg
new file mode 100644
index 0000000000..445f048d92
--- /dev/null
+++ b/railties/guides/assets/images/jaimeiniesta.jpg
Binary files differ
diff --git a/railties/guides/images/nav_arrow.gif b/railties/guides/assets/images/nav_arrow.gif
index c4f57658d7..c4f57658d7 100644
--- a/railties/guides/images/nav_arrow.gif
+++ b/railties/guides/assets/images/nav_arrow.gif
Binary files differ
diff --git a/railties/guides/images/polymorphic.png b/railties/guides/assets/images/polymorphic.png
index ff2fd9f76d..ff2fd9f76d 100644
--- a/railties/guides/images/polymorphic.png
+++ b/railties/guides/assets/images/polymorphic.png
Binary files differ
diff --git a/railties/guides/images/posts_index.png b/railties/guides/assets/images/posts_index.png
index f6cd2f9b80..f6cd2f9b80 100644
--- a/railties/guides/images/posts_index.png
+++ b/railties/guides/assets/images/posts_index.png
Binary files differ
diff --git a/railties/guides/images/rails_guides_logo.gif b/railties/guides/assets/images/rails_guides_logo.gif
index a24683a34e..a24683a34e 100644
--- a/railties/guides/images/rails_guides_logo.gif
+++ b/railties/guides/assets/images/rails_guides_logo.gif
Binary files differ
diff --git a/railties/guides/images/rails_logo_remix.gif b/railties/guides/assets/images/rails_logo_remix.gif
index 58960ee4f9..58960ee4f9 100644
--- a/railties/guides/images/rails_logo_remix.gif
+++ b/railties/guides/assets/images/rails_logo_remix.gif
Binary files differ
diff --git a/railties/guides/images/rails_welcome.png b/railties/guides/assets/images/rails_welcome.png
index 0e02cf5a8c..0e02cf5a8c 100644
--- a/railties/guides/images/rails_welcome.png
+++ b/railties/guides/assets/images/rails_welcome.png
Binary files differ
diff --git a/railties/guides/images/session_fixation.png b/railties/guides/assets/images/session_fixation.png
index 6b084508db..6b084508db 100644
--- a/railties/guides/images/session_fixation.png
+++ b/railties/guides/assets/images/session_fixation.png
Binary files differ
diff --git a/railties/guides/images/tab_grey.gif b/railties/guides/assets/images/tab_grey.gif
index e9680b7136..e9680b7136 100644
--- a/railties/guides/images/tab_grey.gif
+++ b/railties/guides/assets/images/tab_grey.gif
Binary files differ
diff --git a/railties/guides/images/tab_info.gif b/railties/guides/assets/images/tab_info.gif
index 458fea9a61..458fea9a61 100644
--- a/railties/guides/images/tab_info.gif
+++ b/railties/guides/assets/images/tab_info.gif
Binary files differ
diff --git a/railties/guides/images/tab_note.gif b/railties/guides/assets/images/tab_note.gif
index 1d5c171ed6..1d5c171ed6 100644
--- a/railties/guides/images/tab_note.gif
+++ b/railties/guides/assets/images/tab_note.gif
Binary files differ
diff --git a/railties/guides/images/tab_red.gif b/railties/guides/assets/images/tab_red.gif
index daf140b5a8..daf140b5a8 100644
--- a/railties/guides/images/tab_red.gif
+++ b/railties/guides/assets/images/tab_red.gif
Binary files differ
diff --git a/railties/guides/images/tab_yellow.gif b/railties/guides/assets/images/tab_yellow.gif
index dc961c99dd..dc961c99dd 100644
--- a/railties/guides/images/tab_yellow.gif
+++ b/railties/guides/assets/images/tab_yellow.gif
Binary files differ
diff --git a/railties/guides/images/tab_yellow.png b/railties/guides/assets/images/tab_yellow.png
index cceea6581f..cceea6581f 100644
--- a/railties/guides/images/tab_yellow.png
+++ b/railties/guides/assets/images/tab_yellow.png
Binary files differ
diff --git a/railties/guides/images/validation_error_messages.png b/railties/guides/assets/images/validation_error_messages.png
index 622d35da5d..622d35da5d 100644
--- a/railties/guides/images/validation_error_messages.png
+++ b/railties/guides/assets/images/validation_error_messages.png
Binary files differ
diff --git a/railties/guides/files/javascripts/code_highlighter.js b/railties/guides/assets/javascripts/code_highlighter.js
index ce983dad52..ce983dad52 100755
--- a/railties/guides/files/javascripts/code_highlighter.js
+++ b/railties/guides/assets/javascripts/code_highlighter.js
diff --git a/railties/guides/files/javascripts/guides.js b/railties/guides/assets/javascripts/guides.js
index c4e4d459ea..c4e4d459ea 100755
--- a/railties/guides/files/javascripts/guides.js
+++ b/railties/guides/assets/javascripts/guides.js
diff --git a/railties/guides/files/javascripts/highlighters.js b/railties/guides/assets/javascripts/highlighters.js
index 4f5f0779d7..4f5f0779d7 100644
--- a/railties/guides/files/javascripts/highlighters.js
+++ b/railties/guides/assets/javascripts/highlighters.js
diff --git a/railties/guides/files/stylesheets/main.css b/railties/guides/assets/stylesheets/main.css
index 2fd0a2f37e..7ccae2c87e 100644
--- a/railties/guides/files/stylesheets/main.css
+++ b/railties/guides/assets/stylesheets/main.css
@@ -92,7 +92,7 @@ body {
}
#header {
- background: #c52f24 url(../../images/header_tile.gif) repeat-x;
+ background: #c52f24 url(../images/header_tile.gif) repeat-x;
color: #FFF;
padding: 1.5em 0;
position: relative;
@@ -100,7 +100,7 @@ body {
}
#feature {
- background: #d5e9f6 url(../../images/feature_tile.gif) repeat-x;
+ background: #d5e9f6 url(../images/feature_tile.gif) repeat-x;
color: #333;
padding: 0.5em 0 1.5em;
}
@@ -132,7 +132,7 @@ body {
#footer {
padding: 2em 0;
- background: url(../../images/footer_tile.gif) repeat-x;
+ background: url(../images/footer_tile.gif) repeat-x;
}
#footer .wrapper {
padding-left: 2em;
@@ -179,7 +179,7 @@ a, a:link, a:visited {
}
#header .nav .index a {
- background: #980905 url(../../images/nav_arrow.gif) no-repeat right top;
+ background: #980905 url(../images/nav_arrow.gif) no-repeat right top;
padding-right: 1em;
position: relative;
z-index: 15;
@@ -285,7 +285,7 @@ h6 {
#header h1 {
float: left;
- background: url(../../images/rails_guides_logo.gif) no-repeat;
+ background: url(../images/rails_guides_logo.gif) no-repeat;
width: 297px;
text-indent: -9999em;
margin: 0;
@@ -306,7 +306,7 @@ h6 {
#feature ul {margin-left: 0;}
#feature ul li {
list-style: none;
- background: url(../../images/check_bullet.gif) no-repeat left 0.5em;
+ background: url(../images/check_bullet.gif) no-repeat left 0.5em;
padding: 0.5em 1.75em 0.5em 1.75em;
font-size: 1.1428em;
font-weight: bold;
@@ -325,12 +325,12 @@ h6 {
font-size: 1.2857em;
padding: 0.125em 0 0.25em 0;
margin-bottom: 0;
- /*background: url(../../images/book_icon.gif) no-repeat left top;
+ /*background: url(../images/book_icon.gif) no-repeat left top;
padding: 0.125em 0 0.25em 28px;*/
}
#mainCol dd.ticket, #subCol dd.ticket {
- background: #fff9d8 url(../../images/tab_yellow.gif) no-repeat left top;
+ background: #fff9d8 url(../images/tab_yellow.gif) no-repeat left top;
border: none;
padding: 1.25em 1em 1.25em 48px;
margin-left: 0;
@@ -338,7 +338,7 @@ h6 {
}
#mainCol div.warning, #subCol dd.warning {
- background: #f9d9d8 url(../../images/tab_red.gif) no-repeat left top;
+ background: #f9d9d8 url(../images/tab_red.gif) no-repeat left top;
border: none;
padding: 1.25em 1.25em 1.25em 48px;
margin-left: 0;
@@ -355,7 +355,7 @@ h6 {
#subCol .chapters ul li {
list-style: none;
padding: 0 0 0 1em;
- background: url(../../images/bullet.gif) no-repeat left 0.45em;
+ background: url(../images/bullet.gif) no-repeat left 0.45em;
margin-left: 0;
font-size: 1em;
font-weight: normal;
@@ -366,7 +366,7 @@ tt {
}
div.code_container {
- background: #EEE url(../../images/tab_grey.gif) no-repeat left top;
+ background: #EEE url(../images/tab_grey.gif) no-repeat left top;
padding: 0.25em 1em 0.5em 48px;
}
@@ -378,14 +378,14 @@ code {
}
.note {
- background: #fff9d8 url(../../images/tab_note.gif) no-repeat left top;
+ background: #fff9d8 url(../images/tab_note.gif) no-repeat left top;
border: none;
padding: 1em 1em 0.25em 48px;
margin: 0.25em 0 1.5em 0;
}
.info {
- background: #d5e9f6 url(../../images/tab_info.gif) no-repeat left top;
+ background: #d5e9f6 url(../images/tab_info.gif) no-repeat left top;
border: none;
padding: 1em 1em 0.25em 48px;
margin: 0.25em 0 1.5em 0;
@@ -395,7 +395,7 @@ code {
#mainCol ul li {
list-style:none;
- background: url(../../images/grey_bullet.gif) no-repeat left 0.5em;
+ background: url(../images/grey_bullet.gif) no-repeat left 0.5em;
padding-left: 1em;
margin-left: 0;
}
diff --git a/railties/guides/files/stylesheets/print.css b/railties/guides/assets/stylesheets/print.css
index 628da105d4..628da105d4 100755
--- a/railties/guides/files/stylesheets/print.css
+++ b/railties/guides/assets/stylesheets/print.css
diff --git a/railties/guides/files/stylesheets/reset.css b/railties/guides/assets/stylesheets/reset.css
index cb14fbcc55..cb14fbcc55 100755
--- a/railties/guides/files/stylesheets/reset.css
+++ b/railties/guides/assets/stylesheets/reset.css
diff --git a/railties/guides/files/stylesheets/style.css b/railties/guides/assets/stylesheets/style.css
index 89b2ab885a..89b2ab885a 100755
--- a/railties/guides/files/stylesheets/style.css
+++ b/railties/guides/assets/stylesheets/style.css
diff --git a/railties/guides/files/stylesheets/syntax.css b/railties/guides/assets/stylesheets/syntax.css
index 55fc5b209f..55fc5b209f 100644
--- a/railties/guides/files/stylesheets/syntax.css
+++ b/railties/guides/assets/stylesheets/syntax.css
diff --git a/railties/guides/rails_guides/generator.rb b/railties/guides/rails_guides/generator.rb
index 3d48d6b708..f577182f5f 100644
--- a/railties/guides/rails_guides/generator.rb
+++ b/railties/guides/rails_guides/generator.rb
@@ -9,27 +9,23 @@
#
# Some arguments may be passed via environment variables:
#
-# WARN_BROKEN_LINKS
-# Internal references (anchors) are checked. If a reference is broken
-# levenshtein distance is used to suggest an existing one. This is useful
-# since IDs are generated by Textile from titles and thus rewordings alter
-# them.
+# WARNINGS
+# If you are writing a guide, please work always with WARNINGS=1. Users can
+# generate the guides, and thus this flag is off by default.
#
-# WARN_DUPLICATE_HEADERS
-# Warns about duplicate IDs in headers. Please do resolve them, if any,
-# so guides are valid XHTML.
+# Internal links (anchors) are checked. If a reference is broken levenshtein
+# distance is used to suggest an existing one. This is useful since IDs are
+# generated by Textile from headers and thus edits alter them.
#
-# This check only happens if WARN_BROKEN_LINKS is also active.
-#
-# EDGE_GUIDES
-# Set to "1" to indicate edge guides are generated.
+# Also detects duplicated IDs. They happen if there are headers with the same
+# text. Please do resolve them, if any, so guides are valid XHTML.
#
# ALL
-# Generate all guides.
-
+# Set to "1" to force the generation of all guides.
+#
# ONLY
-# If you want to generate only one or a set of guides.
-# Prefixes are enough:
+# Use ONLY if you want to generate only one or a set of guides. Prefixes are
+# enough:
#
# # generates only association_basics.html
# ONLY=assoc ruby rails_guides.rb
@@ -39,9 +35,12 @@
# # generates only
# ONLY=assoc,migrations ruby rails_guides.rb
#
-# Note that if you are working on a guide, generation will
-# by default process only that one, so ONLY is rarely used
-# nowadays.
+# Note that if you are working on a guide generation will by default process
+# only that one, so ONLY is rarely used nowadays.
+#
+# EDGE
+# Set to "1" to indicate generated guides should be marked as edge. This
+# inserts a badge and changes the preamble of the home page.
#
# ---------------------------------------------------------------------------
@@ -85,7 +84,7 @@ module RailsGuides
end
def set_edge
- @edge = ENV['EDGE_GUIDES'] == '1'
+ @edge = ENV['EDGE'] == '1'
end
def generate_guides
@@ -97,19 +96,18 @@ module RailsGuides
def guides_to_generate
guides = Dir.entries(source_dir).grep(GUIDES_RE)
- ENV.key?("ONLY") ? select_only(guides) : guides
+ ENV.key?('ONLY') ? select_only(guides) : guides
end
def select_only(guides)
- prefixes = ENV["ONLY"].split(",").map(&:strip)
+ prefixes = ENV['ONLY'].split(",").map(&:strip)
guides.select do |guide|
prefixes.any? {|p| guide.start_with?(p)}
end
end
def copy_assets
- FileUtils.cp_r(File.join(guides_dir, 'images'), output_dir)
- FileUtils.cp_r(File.join(guides_dir, 'files'), output_dir)
+ FileUtils.cp_r(Dir.glob("#{guides_dir}/assets/*"), output_dir)
end
def output_file_for(guide)
@@ -138,7 +136,7 @@ module RailsGuides
result = view.render(:layout => 'layout', :text => textile(body))
- warn_about_broken_links(result) if ENV.key?("WARN_BROKEN_LINKS")
+ warn_about_broken_links(result) if ENV['WARNINGS'] == '1'
end
f.write result
@@ -229,7 +227,7 @@ module RailsGuides
anchors = Set.new
html.scan(/<h\d\s+id="([^"]+)/).flatten.each do |anchor|
if anchors.member?(anchor)
- puts "*** DUPLICATE HEADER ID: #{anchor}, please consider rewording" if ENV.key?("WARN_DUPLICATE_HEADERS")
+ puts "*** DUPLICATE ID: #{anchor}, please put and explicit ID, e.g. h4(#explicit-id), or consider rewording"
else
anchors << anchor
end
diff --git a/railties/guides/source/action_view_overview.textile b/railties/guides/source/action_view_overview.textile
index 2fa89bb4c2..842a8408ad 100644
--- a/railties/guides/source/action_view_overview.textile
+++ b/railties/guides/source/action_view_overview.textile
@@ -1414,7 +1414,7 @@ Replaces the inner HTML of the DOM element with the given id.
page.replace_html 'person-45', :partial => 'person', :object => @person
</ruby>
-h5. select
+h5(#prototype-select). select
Returns a collection reference by finding it through a CSS pattern in the DOM.
diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile
index a8410a8dd2..b41b16b728 100644
--- a/railties/guides/source/active_support_core_extensions.textile
+++ b/railties/guides/source/active_support_core_extensions.textile
@@ -866,7 +866,7 @@ WARNING: Note that in that case +parent+ returns +Object+.
NOTE: Defined in +active_support/core_ext/module/introspection.rb+.
-h5. +parents+
+h5(#module-parents). +parents+
The method +parents+ calls +parent+ on the receiver and upwards until +Object+ is reached. The chain is returned in an array, from bottom to top:
@@ -2191,9 +2191,9 @@ NOTE: Defined in +active_support/core_ext/array/grouping.rb+.
h3. Extensions to +Hash+
-h4. Conversions
+h4(#hash-conversions). Conversions
-h5. +to_xml+
+h5(#hash-to-xml). +to_xml+
The method +to_xml+ returns a string containing an XML representation of its receiver:
diff --git a/railties/guides/source/contribute.textile b/railties/guides/source/contribute.textile
index 1203e38a4e..8c64df5362 100644
--- a/railties/guides/source/contribute.textile
+++ b/railties/guides/source/contribute.textile
@@ -9,7 +9,7 @@ h3. How to Contribute?
* We have an open commit policy: anyone is welcome to contribute, but you'll need to ask for commit access.
* PM lifo at "GitHub":http://github.com asking for "docrails":http://github.com/lifo/docrails/tree/master commit access.
* Guides are written in Textile, and reside at railties/guides/source in the docrails project.
-* All images are in the railties/guides/images directory.
+* Assets are stored in the +railties/guides/assets+ directory.
* Sample format : "Active Record Associations":http://github.com/lifo/docrails/blob/3e56a3832415476fdd1cb963980d0ae390ac1ed3/railties/guides/source/association_basics.textile
* Sample output : "Active Record Associations":association_basics.html
* You can build the Guides during testing by running +rake generate_guides+ in the +railties+ directory.
diff --git a/railties/guides/source/credits.html.erb b/railties/guides/source/credits.html.erb
index e026628e6a..9851702df9 100644
--- a/railties/guides/source/credits.html.erb
+++ b/railties/guides/source/credits.html.erb
@@ -8,53 +8,59 @@
<h3 class="section">Rails Documentation Team</h3>
<%= author('Mike Gunderloy', 'mgunderloy') do %>
- <p>Mike Gunderloy is a consultant with <a href="http://www.actionrails.com">ActionRails</a>. He brings 25 years of experience in a variety of languages to bear on his current work with Rails. His near-daily links and other blogging can be found at <a href="http://afreshcup.com">A Fresh Cup</a> and he <a href="http://twitter.com/MikeG1">twitters</a> too much.</p>
+ Mike Gunderloy is a consultant with <a href="http://www.actionrails.com">ActionRails</a>. He brings 25 years of experience in a variety of languages to bear on his current work with Rails. His near-daily links and other blogging can be found at <a href="http://afreshcup.com">A Fresh Cup</a> and he <a href="http://twitter.com/MikeG1">twitters</a> too much.
<% end %>
<%= author('Pratik Naik', 'lifo') do %>
- <p>Pratik Naik is a Ruby on Rails consultant with <a href="http://www.actionrails.com">ActionRails</a> and also a member of the <a href="http://rubyonrails.org/core">Rails core team</a>. He maintains a blog at <a href="http://m.onkey.org">has_many :bugs, :through =&gt; :rails</a> and has an active <a href="http://twitter.com/lifo">twitter account</a>.</p>
+ Pratik Naik is a Ruby on Rails consultant with <a href="http://www.actionrails.com">ActionRails</a> and also a member of the <a href="http://rubyonrails.org/core">Rails core team</a>. He maintains a blog at <a href="http://m.onkey.org">has_many :bugs, :through =&gt; :rails</a> and has an active <a href="http://twitter.com/lifo">twitter account</a>.
<% end %>
<%= author('Xavier Noria', 'fxn', 'fxn.png') do %>
- <p>Xavier has been into Rails since 2005, he is currently a Rails consultant. Xavier is Rails committer and enjoys combining his passion for Rails and his past life as a proofreader of math textbooks. Oh, he also <a href="http://twitter.com/fxn">tweets</a> and can be found everywhere as &quot;fxn&quot;.</p>
+ Xavier has been into Rails since 2005, he is currently a Rails consultant. Xavier is Rails committer and enjoys combining his passion for Rails and his past life as a proofreader of math textbooks. Oh, he also <a href="http://twitter.com/fxn">tweets</a> and can be found everywhere as &quot;fxn&quot;.
<% end %>
<h3 class="section">Rails Guides Designers</h3>
<%= author('Jason Zimdars', 'jz') do %>
- <p>Jason Zimdars is an experienced creative director and web designer who has lead UI and UX design for numerous websites and web applications. You can see more of his design and writing at <a href="http://www.thinkcage.com/">Thinkcage.com</a> or follow him on <a href="http://twitter.com/JZ">Twitter</a>.</p>
+ Jason Zimdars is an experienced creative director and web designer who has lead UI and UX design for numerous websites and web applications. You can see more of his design and writing at <a href="http://www.thinkcage.com/">Thinkcage.com</a> or follow him on <a href="http://twitter.com/JZ">Twitter</a>.
<% end %>
<h3 class="section">Rails Guides Authors</h3>
<%= author('Frederick Cheung', 'fcheung') do %>
- <p>Frederick Cheung is Chief Wizard at Texperts where he has been using Rails since 2006. He is based in Cambridge (UK) and when not consuming fine ales he blogs at <a href="http://www.spacevatican.org">spacevatican.org</a>.</p>
+ Frederick Cheung is Chief Wizard at Texperts where he has been using Rails since 2006. He is based in Cambridge (UK) and when not consuming fine ales he blogs at <a href="http://www.spacevatican.org">spacevatican.org</a>.
<% end %>
<%= author('Tore Darell', 'toretore') do %>
- <p>Tore Darell is an independent developer based in Menton, France who specialises in cruft-free web applications using Ruby, Rails and unobtrusive JavaScript. His home on the internet is his blog <a href="http://tore.darell.no">Sneaky Abstractions</a>.</p>
+ Tore Darell is an independent developer based in Menton, France who specialises in cruft-free web applications using Ruby, Rails and unobtrusive JavaScript. His home on the internet is his blog <a href="http://tore.darell.no">Sneaky Abstractions</a>.
<% end %>
<%= author('Jeff Dean', 'zilkey') do %>
- <p>Jeff Dean is a software engineer with <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>
+ Jeff Dean is a software engineer with <a href="http://pivotallabs.com">Pivotal Labs</a>.
<% end %>
<%= author('Cássio Marques', 'cmarques') do %>
- <p>Cássio Marques is a Brazilian software developer working with different programming languages such as Ruby, JavaScript, CPP and Java, as an independent consultant. He blogs at <a href="http://cassiomarques.wordpress.com">/* CODIFICANDO */</a>, which is mainly written in Portuguese, but will soon get a new section for posts with English translation.
+ Cássio Marques is a Brazilian software developer working with different programming languages such as Ruby, JavaScript, CPP and Java, as an independent consultant. He blogs at <a href="http://cassiomarques.wordpress.com">/* CODIFICANDO */</a>, which is mainly written in Portuguese, but will soon get a new section for posts with English translation.
<% end %>
<%= author('James Miller', 'bensie') do %>
- <p>James Miller is a software developer for <a href="http://www.jk-tech.com">JK Tech</a> in San Diego, CA. Find me on GitHub, Gmail, Twitter, and Freenode as &quot;bensie&quot;.</p>
+ James Miller is a software developer for <a href="http://www.jk-tech.com">JK Tech</a> in San Diego, CA. Find me on GitHub, Gmail, Twitter, and Freenode as &quot;bensie&quot;.
<% end %>
<%= author('Emilio Tagua', 'miloops') do %>
- <p>Emilio Tagua &mdash;a.k.a. miloops&mdash; is an Argentinian entrepreneur, developer, open source contributor and Rails evangelist. Cofounder of <a href="http://eventioz.com">Eventioz</a>. He has been using Rails since 2006 and contributing since early 2008. Can be found at gmail, twitter, freenode, everywhere as &quot;miloops&quot;.</p>
+ Emilio Tagua &mdash;a.k.a. miloops&mdash; is an Argentinian entrepreneur, developer, open source contributor and Rails evangelist. Cofounder of <a href="http://eventioz.com">Eventioz</a>. He has been using Rails since 2006 and contributing since early 2008. Can be found at gmail, twitter, freenode, everywhere as &quot;miloops&quot;.
<% end %>
<%= author('Heiko Webers', 'hawe') do %>
- <p>Heiko Webers is the founder of <a href="http://www.bauland42.de">bauland42</a>, a German web application security consulting and development company focused on Ruby on Rails. He blogs at the <a href="http://www.rorsecurity.info">Ruby on Rails Security Project</a>. After 10 years of desktop application development, Heiko has rarely looked back.</p>
+ Heiko Webers is the founder of <a href="http://www.bauland42.de">bauland42</a>, a German web application security consulting and development company focused on Ruby on Rails. He blogs at the <a href="http://www.rorsecurity.info">Ruby on Rails Security Project</a>. After 10 years of desktop application development, Heiko has rarely looked back.
<% end %>
<%= author('Mikel Lindsaar', 'raasdnil') do %>
- <p>Mikel Lindsaar has been working with Rails since 2006 and is the author of the Ruby Mail gem and core contributor (he helped re-write Action Mailer's API). Mikel has a <a href="http://lindsaar.net/">blog</a> and <a href="http://twitter.com/raasdnil">tweets</a>.
+ Mikel Lindsaar has been working with Rails since 2006 and is the author of the Ruby Mail gem and core contributor (he helped re-write Action Mailer's API). Mikel has a <a href="http://lindsaar.net/">blog</a> and <a href="http://twitter.com/raasdnil">tweets</a>.
+<% end %>
+
+<h3 class="section">Rails Guides Reviewers</h3>
+
+<%= author('Jaime Iniesta', 'jaimeiniesta', 'jaimeiniesta.jpg') do %>
+ Jaime Iniesta works as a Ruby on Rails freelance developer since 2005. He's a member of <a href="http://www.prorubyteam.com">ProRuby</a>, co-founder of the <a href="http://srug.org">Spanish Ruby Users Group</a>, member of <a href="http://spainrb.org">Spain.rb</a>, and organizer of <a href="http://conferenciarails.org">Conferencia Rails</a> and <a href="http://euruko2009.org">EuRuKo 2009</a>. Jaime has a <a href="http://jaimeiniesta.com">blog</a> and <a href="http://twitter.com/jaimeiniesta">tweets</a>.
<% end %>
diff --git a/railties/guides/source/debugging_rails_applications.textile b/railties/guides/source/debugging_rails_applications.textile
index cd0098d686..3eddf1a2b1 100644
--- a/railties/guides/source/debugging_rails_applications.textile
+++ b/railties/guides/source/debugging_rails_applications.textile
@@ -286,7 +286,7 @@ condition down finish list ps save thread var
continue edit frame method putl set tmate where
</shell>
-TIP: To view the help menu for any command use +help <command-name>+ in active debug mode. For example: _+help var+_
+TIP: To view the help menu for any command use +help &lt;command-name&gt;+ in active debug mode. For example: _+help var+_
The next command to learn is one of the most useful: +list+. You can also abbreviate ruby-debug commands by supplying just enough letters to distinguish them from other commands, so you can also use +l+ for the +list+ command.
@@ -704,6 +704,7 @@ h3. Changelog
"Lighthouse ticket":http://rails.lighthouseapp.com/projects/16213-rails-guides/tickets/5
+* April 4, 2010: Fixed document to validate XHTML 1.0 Strict. "Jaime Iniesta":credits.html#jaimeiniesta
* November 3, 2008: Accepted for publication. Added RJS, memory leaks and plugins chapters by "Emilio Tagua":credits.html#miloops
* October 19, 2008: Copy editing pass by "Mike Gunderloy":credits.html#mgunderloy
* September 16, 2008: initial version by "Emilio Tagua":credits.html#miloops
diff --git a/railties/guides/source/form_helpers.textile b/railties/guides/source/form_helpers.textile
index d33bb4b4ff..fe0f8f1ac9 100644
--- a/railties/guides/source/form_helpers.textile
+++ b/railties/guides/source/form_helpers.textile
@@ -501,7 +501,7 @@ Date.civil(params[:start_date][:year].to_i, params[:start_date][:month].to_i, pa
The +:prefix+ option is the key used to retrieve the hash of date components from the +params+ hash. Here it was set to +start_date+, if omitted it will default to +date+.
-h4. Model Object Helpers
+h4(#select-model-object-helpers). Model Object Helpers
+select_date+ does not work well with forms that update or create Active Record objects as Active Record expects each element of the +params+ hash to correspond to one attribute.
The model object helpers for dates and times submit parameters with special names, when Active Record sees parameters with such names it knows they must be combined with the other parameters and given to a constructor appropriate to the column type. For example:
diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index 9cc96f8205..9669f7f155 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -1432,6 +1432,7 @@ h3. Changelog
"Lighthouse ticket":http://rails.lighthouseapp.com/projects/16213-rails-guides/tickets/2
+* April 1, 2010: Fixed document to validate XHTML 1.0 Strict. "Jaime Iniesta":credits.html#jaimeiniesta
* February 8, 2010: Full re-write for Rails 3.0-beta, added helpers and before_filters, refactored code by "Mikel Lindsaar":credits:html#raasdnil
* January 24, 2010: Re-write for Rails 3.0 by "Mikel Lindsaar":credits:html#raasdnil
* July 18, 2009: Minor cleanup in anticipation of Rails 2.3.3 by "Mike Gunderloy":credits.html#mgunderloy
diff --git a/railties/guides/source/layout.html.erb b/railties/guides/source/layout.html.erb
index 9819db1f89..b280101d25 100644
--- a/railties/guides/source/layout.html.erb
+++ b/railties/guides/source/layout.html.erb
@@ -7,13 +7,13 @@
<title><%= yield(:page_title) || 'Ruby on Rails guides' %></title>
-<link rel="stylesheet" type="text/css" href="files/stylesheets/style.css" />
-<link rel="stylesheet" type="text/css" href="files/stylesheets/syntax.css" />
-<link rel="stylesheet" type="text/css" href="files/stylesheets/print.css" media="print" />
+<link rel="stylesheet" type="text/css" href="stylesheets/style.css" />
+<link rel="stylesheet" type="text/css" href="stylesheets/syntax.css" />
+<link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print" />
-<script type="text/javascript" src="files/javascripts/guides.js"></script>
-<script type="text/javascript" src="files/javascripts/code_highlighter.js"></script>
-<script type="text/javascript" src="files/javascripts/highlighters.js"></script>
+<script type="text/javascript" src="javascripts/guides.js"></script>
+<script type="text/javascript" src="javascripts/code_highlighter.js"></script>
+<script type="text/javascript" src="javascripts/highlighters.js"></script>
</head>
<body class="guide">
diff --git a/railties/guides/source/layouts_and_rendering.textile b/railties/guides/source/layouts_and_rendering.textile
index 2cb98e9ee6..d9781fc966 100644
--- a/railties/guides/source/layouts_and_rendering.textile
+++ b/railties/guides/source/layouts_and_rendering.textile
@@ -510,7 +510,7 @@ def show
end
</ruby>
-Make sure you use +and return+ and not +&& return+ because while the former will work, the latter will not due to operator precedence in the Ruby Language.
+Make sure you use +and return+ and not +&amp;&amp; return+ because while the former will work, the latter will not due to operator precedence in the Ruby Language.
Note that the implicit render done by ActionController detects if +render+ has been called, and thus avoids this error. Therefore, the following will work without errors:
@@ -747,7 +747,7 @@ You can even use dynamic paths such as +cache/#{current_site}/main/display+.
h5. Linking to CSS Files with +stylesheet_link_tag+
-The +stylesheet_link_tag+ helper returns an HTML +<link>+ tag for each source provided. Rails looks in +public/stylesheets+ for these files by default, but you can specify a full path relative to the document root, or a URL, if you prefer. For example, to include +public/stylesheets/main.cs+:
+The +stylesheet_link_tag+ helper returns an HTML +&lt;link&gt;+ tag for each source provided. Rails looks in +public/stylesheets+ for these files by default, but you can specify a full path relative to the document root, or a URL, if you prefer. For example, to include +public/stylesheets/main.cs+:
<erb>
<%= stylesheet_link_tag "main" %>
@@ -1197,6 +1197,7 @@ h3. Changelog
"Lighthouse ticket":http://rails.lighthouseapp.com/projects/16213-rails-guides/tickets/15
+* April 4, 2010: Fixed document to validate XHTML 1.0 Strict. "Jaime Iniesta":credits.html#jaimeiniesta
* January 25, 2010: Rails 3.0 Update by "Mikel Lindsaar":credits.html#raasdnil
* December 27, 2008: Merge patch from Rodrigo Rosenfeld Rosas covering subtemplates
* December 27, 2008: Information on new rendering defaults by "Mike Gunderloy":credits.html#mgunderloy
diff --git a/railties/guides/source/performance_testing.textile b/railties/guides/source/performance_testing.textile
index 5c760a5966..f74b68b0ef 100644
--- a/railties/guides/source/performance_testing.textile
+++ b/railties/guides/source/performance_testing.textile
@@ -213,11 +213,11 @@ h4. Understanding the Output
Performance tests generate different outputs inside +tmp/performance+ directory depending on their mode and metric.
-h5. Benchmarking
+h5(#output-benchmarking). Benchmarking
In benchmarking mode, performance tests generate two types of outputs:
-h6. Command Line
+h6(#output-command-line). Command Line
This is the primary form of output in benchmarking mode. Example:
@@ -258,7 +258,7 @@ measurement,created_at,app,rails,ruby,platform
0.00771250000000012,2009-01-09T15:46:03Z,,2.3.0.master.859e150,ruby-1.8.6.110,i686-darwin9.0.0
</shell>
-h5. Profiling
+h5(#output-profiling). Profiling
In profiling mode, you can choose from four types of output.
@@ -330,7 +330,7 @@ h5. Apply the Patch
h5. Configure and Install
-The following will install ruby in your home directory's +/rubygc+ directory. Make sure to replace +<homedir>+ with a full patch to your actual home directory.
+The following will install ruby in your home directory's +/rubygc+ directory. Make sure to replace +&lt;homedir&gt;+ with a full patch to your actual home directory.
<shell>
[lifo@null ruby-version]$ ./configure --prefix=/<homedir>/rubygc
diff --git a/railties/guides/source/plugins.textile b/railties/guides/source/plugins.textile
index 2db421aa91..74c8ee2df9 100644
--- a/railties/guides/source/plugins.textile
+++ b/railties/guides/source/plugins.textile
@@ -35,14 +35,14 @@ h4. Create the Basic Application
The examples in this guide require that you have a working rails application. To create a simple rails app execute:
-<pre>
+<shell>
gem install rails
rails yaffle_guide
cd yaffle_guide
rails generate scaffold bird name:string
rake db:migrate
rails server
-</pre>
+</shell>
Then navigate to http://localhost:3000/birds. Make sure you have a functioning rails app before continuing.
@@ -56,22 +56,22 @@ Rails ships with a plugin generator which creates a basic plugin skeleton. Pass
This creates a plugin in 'vendor/plugins' including an 'init.rb' and 'README' as well as standard 'lib', 'task', and 'test' directories.
Examples:
-<pre>
+<shell>
rails generate plugin yaffle
rails generate plugin yaffle --with-generator
-</pre>
+</shell>
To get more detailed help on the plugin generator, type +rails generate plugin+.
Later on this guide will describe how to work with generators, so go ahead and generate your plugin with the +--with-generator+ option now:
-<pre>
+<shell>
rails generate plugin yaffle --with-generator
-</pre>
+</shell>
You should see the following output:
-<pre>
+<shell>
create vendor/plugins/yaffle/lib
create vendor/plugins/yaffle/tasks
create vendor/plugins/yaffle/test
@@ -89,20 +89,20 @@ create vendor/plugins/yaffle/generators/yaffle
create vendor/plugins/yaffle/generators/yaffle/templates
create vendor/plugins/yaffle/generators/yaffle/yaffle_generator.rb
create vendor/plugins/yaffle/generators/yaffle/USAGE
-</pre>
+</shell>
h4. Organize Your Files
To make it easy to organize your files and to make the plugin more compatible with GemPlugins, start out by altering your file system to look like this:
-<pre>
+<shell>
|-- lib
| |-- yaffle
| `-- yaffle.rb
`-- rails
|
`-- init.rb
-</pre>
+</shell>
*vendor/plugins/yaffle/init.rb*
@@ -124,7 +124,7 @@ h4. Test Setup
*vendor/plugins/yaffle/test/database.yml:*
-<pre>
+<yaml>
sqlite:
:adapter: sqlite
:dbfile: vendor/plugins/yaffle/test/yaffle_plugin.sqlite.db
@@ -146,7 +146,7 @@ mysql:
:username: root
:password: password
:database: yaffle_plugin_test
-</pre>
+</yaml>
For this guide you'll need 2 tables/models, Hickwalls and Wickwalls, so add the following:
@@ -239,10 +239,10 @@ end
To run this, go to the plugin directory and run +rake+:
-<pre>
+<shell>
cd vendor/plugins/yaffle
rake
-</pre>
+</shell>
You should see output like:
@@ -1511,4 +1511,5 @@ h3. Changelog
"Lighthouse ticket":http://rails.lighthouseapp.com/projects/16213/tickets/32-update-plugins-guide
+* April 4, 2010: Fixed document to validate XHTML 1.0 Strict. "Jaime Iniesta":credits.html#jaimeiniesta
* November 17, 2008: Major revision by Jeff Dean
diff --git a/railties/guides/source/routing.textile b/railties/guides/source/routing.textile
index 6625412684..0cf8c45761 100644
--- a/railties/guides/source/routing.textile
+++ b/railties/guides/source/routing.textile
@@ -65,7 +65,7 @@ RESTful routes take advantage of the built-in REST orientation of Rails to wrap
resources :books
</ruby>
-h4. Named Routes
+h4(#quick-tour-named-routes). Named Routes
Named routes give you very readable links in your code, as well as handling incoming requests. Here's a typical named route:
@@ -91,7 +91,7 @@ resources :assemblies do
end
</ruby>
-h4. Regular Routes
+h4(#quick-tour-regular-routes). Regular Routes
In many applications, you'll also see non-RESTful routing, which explicitly connects the parts of a URL to a particular action. For example,
@@ -400,7 +400,7 @@ In addition to the routes for magazines, this declaration will also create route
This will also create routing helpers such as +magazine_ads_url+ and +edit_magazine_ad_path+.
-h5. Using +:name_prefix+
+h5(#nested-name-prefix). Using +:name_prefix+
The +:name_prefix+ option overrides the automatically-generated prefix in nested route helpers. For example,
diff --git a/railties/guides/source/security.textile b/railties/guides/source/security.textile
index b62ff8cb38..1ddf094d18 100644
--- a/railties/guides/source/security.textile
+++ b/railties/guides/source/security.textile
@@ -611,7 +611,7 @@ h4. SQL Injection
-- _Thanks to clever methods, this is hardly a problem in most Rails applications. However, this is a very devastating and common attack in web applications, so it is important to understand the problem._
-h5. Introduction
+h5(#sql-injection-introduction). Introduction
SQL injection attacks aim at influencing database queries by manipulating web application parameters. A popular goal of SQL injection attacks is to bypass authorization. Another goal is to carry out data manipulation or reading arbitrary data. Here is an example of how not to use user input data in a query:
@@ -668,7 +668,7 @@ The result won't be a list of projects (because there is no project with an empt
Also, the second query renames some columns with the AS statement so that the web application displays the values from the user table. Be sure to update your Rails "to at least 2.1.1":http://www.rorsecurity.info/2008/09/08/sql-injection-issue-in-limit-and-offset-parameter/.
-h5. Countermeasures
+h5(#sql-injection-countermeasures). Countermeasures
Ruby on Rails has a built in filter for special SQL characters, which will escape ' , " , NULL character and line breaks. <em class="highlight">Using +Model.find(id)+ or +Model.find_by_some thing(something)+ automatically applies this countermeasure</em>. But in SQL fragments, especially <em class="highlight">in conditions fragments (+:conditions => "..."+), the +connection.execute()+ or +Model.find_by_sql()+ methods, it has to be applied manually</em>.
@@ -760,7 +760,7 @@ http://www.cbsnews.com/stories/2002/02/15/weather_local/main501644.shtml?zipcode
<script src=http://www.securitylab.ru/test/sc.js></script><!--
</plain>
-h6. Countermeasures
+h6(#html-injection-countermeasures). Countermeasures
_(highlight)It is very important to filter malicious input, but it is also important to escape the output of the web application_.
@@ -850,7 +850,7 @@ In the end, he got a 4 KB worm, which he injected into his profile page.
The "moz-binding":http://www.securiteam.com/securitynews/5LP051FHPE.html CSS property proved to be another way to introduce JavaScript in CSS in Gecko-based browsers (Firefox, for example).
-h5. Countermeasures
+h5(#css-injection-countermeasures). Countermeasures
This example, again, showed that a blacklist filter is never complete. However, as custom CSS in web applications is a quite rare feature, I am not aware of a whitelist CSS filter. _(highlight)If you want to allow custom colours or images, you can allow the user to choose them and build the CSS in the web application_. Use Rails' +sanitize()+ method as a model for a whitelist CSS filter, if you really need one.
@@ -879,7 +879,7 @@ RedCloth.new("<a href='javascript:alert(1)'>hello</a>", [:filter_html]).to_html
# => "<p><a href="javascript:alert(1)">hello</a></p>"
</ruby>
-h5. Countermeasures
+h5(#textile-injection-countermeasures). Countermeasures
It is recommended to _(highlight)use RedCloth in combination with a whitelist input filter_, as described in the countermeasures against XSS section.
diff --git a/railties/guides/source/testing.textile b/railties/guides/source/testing.textile
index ac9fb4276e..b1eee0ccb9 100644
--- a/railties/guides/source/testing.textile
+++ b/railties/guides/source/testing.textile
@@ -411,7 +411,7 @@ NOTE: +assert_valid(record)+ has been deprecated. Please use +assert(record.vali
|_.Assertion |_.Purpose|
|+assert_valid(record)+ |Ensures that the passed record is valid by Active Record standards and returns any error messages if it is not.|
|+assert_difference(expressions, difference = 1, message = nil) {...}+ |Test numeric difference between the return value of an expression as a result of what is evaluated in the yielded block.|
-|+assert_no_difference(expressions, message = nil, &block)+ |Asserts that the numeric result of evaluating an expression is not changed before and after invoking the passed in block.|
+|+assert_no_difference(expressions, message = nil, &amp;block)+ |Asserts that the numeric result of evaluating an expression is not changed before and after invoking the passed in block.|
|+assert_recognizes(expected_options, path, extras={}, message=nil)+ |Asserts that the routing of the given path was handled correctly and that the parsed options (given in the expected_options hash) match path. Basically, it asserts that Rails recognizes the route given by expected_options.|
|+assert_generates(expected_path, options, defaults={}, extras = {}, message=nil)+ |Asserts that the provided options can be used to generate the provided path. This is the inverse of assert_recognizes. The extras parameter is used to tell the request the names and values of additional request parameters that would be in a query string. The message parameter allows you to specify a custom error message for assertion failures.|
|+assert_response(type, message = nil)+ |Asserts that the response comes with a specific status code. You can specify +:success+ to indicate 200, +:redirect+ to indicate 300-399, +:missing+ to indicate 404, or +:error+ to match the 500-599 range|
@@ -940,6 +940,7 @@ h3. Changelog
"Lighthouse ticket":http://rails.lighthouseapp.com/projects/16213-rails-guides/tickets/8
+* April 4, 2010: Fixed document to validate XHTML 1.0 Strict. "Jaime Iniesta":credits.html#jaimeiniesta
* November 13, 2008: Revised based on feedback from Pratik Naik by "Akshay Surve":credits.html#asurve (not yet approved for publication)
* October 14, 2008: Edit and formatting pass by "Mike Gunderloy":credits.html#mgunderloy (not yet approved for publication)
* October 12, 2008: First draft by "Akshay Surve":credits.html#asurve (not yet approved for publication)