aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides
diff options
context:
space:
mode:
Diffstat (limited to 'railties/guides')
-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)39
-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.rb101
-rw-r--r--railties/guides/source/action_view_overview.textile4
-rw-r--r--railties/guides/source/active_support_core_extensions.textile6
-rw-r--r--railties/guides/source/association_basics.textile2
-rw-r--r--railties/guides/source/contribute.textile2
-rw-r--r--railties/guides/source/credits.html.erb66
-rw-r--r--railties/guides/source/credits.textile.erb60
-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.textile5
-rw-r--r--railties/guides/source/index.html.erb150
-rw-r--r--railties/guides/source/index.textile.erb139
-rw-r--r--railties/guides/source/layout.html.erb22
-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.textile151
-rw-r--r--railties/guides/source/security.textile10
-rw-r--r--railties/guides/source/testing.textile3
95 files changed, 397 insertions, 410 deletions
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 d377628d73..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;
}
@@ -439,3 +439,14 @@ spurious blank area below with the box background. */
div.important p, div.caution p, div.warning p, div.note p, div.info p {
margin-bottom: 0px;
}
+
+/* Edge Badge
+--------------------------------------- */
+
+#edge-badge {
+ position: fixed;
+ right: 0px;
+ top: 0px;
+ z-index: 100;
+ border: none;
+}
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 e30dd2d5f7..f577182f5f 100644
--- a/railties/guides/rails_guides/generator.rb
+++ b/railties/guides/rails_guides/generator.rb
@@ -1,3 +1,49 @@
+# ---------------------------------------------------------------------------
+#
+# This script generates the guides. It can be invoked either directly or via the
+# generate_guides rake task within the railties directory.
+#
+# Guides are taken from the source directory, and the resulting HTML goes into the
+# output directory. Assets are stored under files, and copied to output/files as
+# part of the generation process.
+#
+# Some arguments may be passed via environment variables:
+#
+# 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.
+#
+# 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.
+#
+# 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
+# Set to "1" to force the generation of all guides.
+#
+# ONLY
+# 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
+#
+# Separate many using commas:
+#
+# # 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.
+#
+# 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.
+#
+# ---------------------------------------------------------------------------
+
require 'set'
require 'fileutils'
@@ -11,11 +57,14 @@ require 'rails_guides/levenshtein'
module RailsGuides
class Generator
- attr_reader :guides_dir, :source_dir, :output_dir
+ attr_reader :guides_dir, :source_dir, :output_dir, :edge
+
+ GUIDES_RE = /\.(?:textile|html\.erb)$/
def initialize(output=nil)
initialize_dirs(output)
create_output_dir_if_needed
+ set_edge
end
def generate
@@ -32,7 +81,11 @@ module RailsGuides
def create_output_dir_if_needed
FileUtils.mkdir_p(output_dir)
- end
+ end
+
+ def set_edge
+ @edge = ENV['EDGE'] == '1'
+ end
def generate_guides
guides_to_generate.each do |guide|
@@ -42,24 +95,23 @@ module RailsGuides
end
def guides_to_generate
- guides = Dir.entries(source_dir).grep(/\.textile(?:\.erb)?$/)
- ENV.key?("ONLY") ? select_only(guides) : guides
+ guides = Dir.entries(source_dir).grep(GUIDES_RE)
+ 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'), File.join(output_dir, 'images'))
- FileUtils.cp_r(File.join(guides_dir, 'files'), File.join(output_dir, 'files'))
+ FileUtils.cp_r(Dir.glob("#{guides_dir}/assets/*"), output_dir)
end
def output_file_for(guide)
- guide.sub(/\.textile(?:\.erb)?$/, '.html')
+ guide.sub(GUIDES_RE, '.html')
end
def generate?(source_file, output_file)
@@ -71,13 +123,12 @@ module RailsGuides
def generate_guide(guide, output_file)
puts "Generating #{output_file}"
File.open(File.join(output_dir, output_file), 'w') do |f|
- view = ActionView::Base.new(source_dir)
+ view = ActionView::Base.new(source_dir, :edge => edge)
view.extend(Helpers)
-
- if guide =~ /\.textile\.erb$/
- # Generate the erb pages with textile formatting - e.g. index/authors
+
+ if guide =~ /\.html\.erb$/
+ # Generate the special pages like the home.
result = view.render(:layout => 'layout', :file => guide)
- result = textile(result)
else
body = File.read(File.join(source_dir, guide))
body = set_header_section(body, view)
@@ -85,14 +136,9 @@ 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
-
- # FIXME: If the doctype is in the layout textile escapes it.
- # Things should be set up in a way that prevents that, a doctype
- # belongs to the layout.
- result = insert_doctype(result)
- result = insert_edge_badge(result) if ENV.key?('INSERT_EDGE_BADGE')
+
f.write result
end
end
@@ -130,7 +176,7 @@ module RailsGuides
view.content_tag(:li, l.html_safe)
end
- children_ul = view.content_tag(:ul, children.join(" ").html_safe)
+ children_ul = children.empty? ? "" : view.content_tag(:ul, children.join(" ").html_safe)
index << view.content_tag(:li, link.html_safe + children_ul.html_safe)
end
@@ -181,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
@@ -203,16 +249,5 @@ module RailsGuides
end
end
end
-
- def insert_doctype(html)
- <<EOS + html
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-EOS
- end
-
- def insert_edge_badge(html)
- html.sub(/<body[^>]*>/, '\&<img src="images/edge_badge.png" style="position:fixed; right:0px; top:0px; border:none; z-index:100"/>')
- end
end
end
diff --git a/railties/guides/source/action_view_overview.textile b/railties/guides/source/action_view_overview.textile
index a517193cea..842a8408ad 100644
--- a/railties/guides/source/action_view_overview.textile
+++ b/railties/guides/source/action_view_overview.textile
@@ -1079,7 +1079,7 @@ h4. JavaScriptHelper
Provides functionality for working with JavaScript in your views.
-Rails includes the Prototype JavaScript framework and the Scriptaculous JavaScript controls and visual effects library. If you wish to use these libraries and their helpers, make sure +<%= javascript_include_tag :defaults, :cache => true %>+ is in the HEAD section of your page. This function will include the necessary JavaScript files Rails generated in the public/javascripts directory.
+Rails includes the Prototype JavaScript framework and the Scriptaculous JavaScript controls and visual effects library. If you wish to use these libraries and their helpers, make sure +&lt;%= javascript_include_tag :defaults, :cache => true %&gt;+ is in the HEAD section of your page. This function will include the necessary JavaScript files Rails generated in the public/javascripts directory.
h5. button_to_function
@@ -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/association_basics.textile b/railties/guides/source/association_basics.textile
index 757dce1f4e..4256466bec 100644
--- a/railties/guides/source/association_basics.textile
+++ b/railties/guides/source/association_basics.textile
@@ -417,7 +417,7 @@ h5. Creating Join Tables for +has_and_belongs_to_many+ Associations
If you create a +has_and_belongs_to_many+ association, you need to explicitly create the joining table. Unless the name of the join table is explicitly specified by using the +:join_table+ option, Active Record creates the name by using the lexical order of the class names. So a join between customer and order models will give the default join table name of "customers_orders" because "c" outranks "o" in lexical ordering.
-WARNING: The precedence between model names 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 lexical precedence than the shorter one. For example, one would expect the tables "paper_boxes" and "papers" to generate a join table name of "papers_paper_boxes" because of the length of the name "paper_boxes", but it in fact generates a join table name of "paper_boxes_papers" (because the underscore '_' is lexicographically _less_ than 's' in common encodings).
+WARNING: The precedence between model names is calculated using the +&lt;+ 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 lexical precedence than the shorter one. For example, one would expect the tables "paper_boxes" and "papers" to generate a join table name of "papers_paper_boxes" because of the length of the name "paper_boxes", but it in fact generates a join table name of "paper_boxes_papers" (because the underscore '_' is lexicographically _less_ than 's' in common encodings).
Whatever the name, you must manually generate the join table with an appropriate migration. For example, consider these associations:
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
new file mode 100644
index 0000000000..9851702df9
--- /dev/null
+++ b/railties/guides/source/credits.html.erb
@@ -0,0 +1,66 @@
+<% content_for :header_section do %>
+<h2>Credits</h2>
+
+<p>We'd like to thank the following people for their tireless contributions to this project.</p>
+
+<% end %>
+
+<h3 class="section">Rails Documentation Team</h3>
+
+<%= author('Mike Gunderloy', 'mgunderloy') do %>
+ 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 %>
+ 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 %>
+ 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 %>
+ 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 %>
+ 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 %>
+ 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 %>
+ Jeff Dean is a software engineer with <a href="http://pivotallabs.com">Pivotal Labs</a>.
+<% end %>
+
+<%= author('Cássio Marques', 'cmarques') do %>
+ 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 %>
+ 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 %>
+ 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 %>
+ 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 %>
+ 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/credits.textile.erb b/railties/guides/source/credits.textile.erb
deleted file mode 100644
index 0c54049e1c..0000000000
--- a/railties/guides/source/credits.textile.erb
+++ /dev/null
@@ -1,60 +0,0 @@
-<% content_for :header_section do %>
-h2. Credits
-
-p. We'd like to thank the following people for their tireless contributions to this project.
-
-<% end %>
-
-<h3 class="section">Rails Documentation Team</h3>
-
-<%= author('Mike Gunderloy', 'mgunderloy') do %>
- Mike Gunderloy is a consultant with "ActionRails":http://www.actionrails.com. 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 Fresh Cup":http://afreshcup.com and he "twitters":http://twitter.com/MikeG1 too much.
-<% end %>
-
-<%= author('Pratik Naik', 'lifo') do %>
- Pratik Naik is a Ruby on Rails consultant with "ActionRails":http://www.actionrails.com and also a member of the "Rails core team":http://rubyonrails.org/core. He maintains a blog at "has_many :bugs, :through => :rails":http://m.onkey.org and has an active "twitter account":http://twitter.com/lifo.
-<% end %>
-
-<%= author('Xavier Noria', 'fxn', 'fxn.png') do %>
- Xavier has been into Rails since 2005, he is currently a Rails consultant. Xavier is president of the <a href="http://www.srug.org/">Spanish Ruby Users Group</a> and has been involved in Rails in several ways. He enjoys combining his passion for Rails and his past life as a proofreader of math textbooks. Oh, he also "tweets":http://twitter.com/fxn!
-<% end %>
-
-<h3 class="section">Rails Guides Designers</h3>
-
-<%= author('Jason Zimdars', 'jz') do %>
- 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 %>
- 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 "spacevatican.org":http://www.spacevatican.org.
-<% end %>
-
-<%= author('Tore Darell', 'toretore') do %>
- 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 "Sneaky Abstractions":http://tore.darell.no.
-<% end %>
-
-<%= author('Jeff Dean', 'zilkey') do %>
- Jeff Dean is a software engineer with "Pivotal Labs":http://pivotallabs.com.
-<% end %>
-
-<%= author('Cássio Marques', 'cmarques') do %>
- 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 "/* CODIFICANDO */":http://cassiomarques.wordpress.com, which is mainly written in Portuguese, but will soon get a new section for posts with English translation.
-<% end %>
-
-<%= author('James Miller', 'bensie') do %>
- James Miller is a software developer for "JK Tech":http://www.jk-tech.com in San Diego, CA. Find me on GitHub, Gmail, Twitter, and Freenode as bensie.
-<% end %>
-
-<%= author('Emilio Tagua', 'miloops') do %>
- Emilio Tagua -- a.k.a. miloops -- is an Argentinian entrepreneur, developer, open source contributor and Rails evangelist. Cofounder of "Eventioz":http://eventioz.com. He has been using Rails since 2006 and contributing since early 2008. Can be found at gmail, twitter, freenode, everywhere as miloops.
-<% end %>
-
-<%= author('Heiko Webers', 'hawe') do %>
- Heiko Webers is the founder of "bauland42":http://www.bauland42.de, a German web application security consulting and development company focused on Ruby on Rails. He blogs at the "Ruby on Rails Security Project":http://www.rorsecurity.info. After 10 years of desktop application development, Heiko has rarely looked back.
-<% end %>
-
-<%= author('Mikel Lindsaar', 'raasdnil') do %>
- 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 ActionMailer's API). Mikel has a "blog":http://lindsaar.net/ and "tweets":http://twitter.com/raasdnil.
-<% 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 c479c2fb20..9669f7f155 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -545,7 +545,7 @@ This view iterates over the contents of the +@posts+ array to display content an
* +link_to+ builds a hyperlink to a particular destination
* +edit_post_path+ is a helper that Rails provides as part of RESTful routing. You'll see a variety of these helpers for the different actions that the controller includes.
-NOTE. In previous versions of Rails, you had to use +<%=h post.name %>+ so that any HTML would be escaped before being inserted into the page. In Rails 3.0, this is now the default. To get unescaped HTML, you now use +<%= raw post.name %>+.
+NOTE. In previous versions of Rails, you had to use +&lt;%=h post.name %&gt;+ so that any HTML would be escaped before being inserted into the page. In Rails 3.0, this is now the default. To get unescaped HTML, you now use +&lt;%= raw post.name %&gt;+.
TIP: For more details on the rendering process, see "Layouts and Rendering in Rails":layouts_and_rendering.html.
@@ -597,7 +597,7 @@ The +new.html.erb+ view displays this empty Post to the user:
<%= link_to 'Back', posts_path %>
</erb>
-The +<%= render 'form' %>+ line is our first introduction to _partials_ in Rails. A partial is a snippet of HTML and Ruby code that can be reused in multiple locations. In this case, the form used to make a new post, is basically identical to a form used to edit a post, both have text fields for the name and title and a text area for the content with a button to make a new post or update the existing post.
+The +&lt;%= render 'form' %&gt;+ line is our first introduction to _partials_ in Rails. A partial is a snippet of HTML and Ruby code that can be reused in multiple locations. In this case, the form used to make a new post, is basically identical to a form used to edit a post, both have text fields for the name and title and a text area for the content with a button to make a new post or update the existing post.
If you take a look at +views/posts/_form.html.erb+ file, you will see the following:
@@ -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/index.html.erb b/railties/guides/source/index.html.erb
new file mode 100644
index 0000000000..8864b52325
--- /dev/null
+++ b/railties/guides/source/index.html.erb
@@ -0,0 +1,150 @@
+<% content_for :header_section do %>
+<h2>Ruby on Rails Guides</h2>
+
+<% if @edge %>
+<p>
+ These are <b>Edge Guides</b>, based on the current
+ <a href="http://github.com/rails/rails/tree/master">master branch</a>.
+</p>
+<p>
+ If you are looking for the ones for the stable version please check
+ <a href="http://guides.rubyonrails.org">http://guides.rubyonrails.org</a> instead.
+</p>
+<% end %>
+
+<p>
+ These guides are designed to make you immediately productive with Rails,
+ and to help you understand how all of the pieces fit together.
+</p>
+
+<% end %>
+
+<% content_for :index_section do %>
+<div id="subCol">
+ <dl>
+ <dd class="warning">Rails Guides are a result of the ongoing <a href="http://hackfest.rubyonrails.org">Guides hackfest</a>, and a work in progress.</dd>
+ <dd class="ticket">Guides marked with this icon are currently being worked on. While they might still be useful to you, they may contain incomplete information and even errors. You can help by reviewing them and posting your comments and corrections at the respective Lighthouse ticket.</dd>
+ </dl>
+</div>
+<% end %>
+
+<h3>Start Here</h3>
+
+<dl>
+<%= guide('Getting Started with Rails', 'getting_started.html') do %>
+ <p>Everything you need to know to install Rails and create your first application.</p>
+<% end %>
+</dl>
+
+<h3>Models</h3>
+
+<dl>
+<%= guide("Rails Database Migrations", 'migrations.html') do %>
+ <p>This guide covers how you can use Active Record migrations to alter your database in a structured and organized manner.</p>
+<% end %>
+
+<%= guide("Active Record Validations and Callbacks", 'activerecord_validations_callbacks.html') do %>
+ <p>This guide covers how you can use Active Record validations and callbacks.</p>
+<% end %>
+
+<%= guide("Active Record Associations", 'association_basics.html') do %>
+ <p>This guide covers all the associations provided by Active Record.</p>
+<% end %>
+
+<%= guide("Active Record Query Interface", 'active_record_querying.html') do %>
+ <p>This guide covers the database query interface provided by Active Record.</p>
+<% end %>
+</dl>
+
+<h3>Views</h3>
+
+<dl>
+<%= guide("Layouts and Rendering in Rails", 'layouts_and_rendering.html') do %>
+ <p>This guide covers the basic layout features of Action Controller and Action View, including rendering and redirecting, using content_for blocks, and working with partials.</p>
+<% end %>
+
+<%= guide("Action View Form Helpers", 'form_helpers.html', :ticket => 1) do %>
+ <p>Guide to using built in Form helpers.</p>
+<% end %>
+</dl>
+
+<h3>Controllers</h3>
+
+<dl>
+<%= guide("Action Controller Overview", 'action_controller_overview.html') do %>
+ <p>This guide covers how controllers work and how they fit into the request cycle in your application. It includes sessions, filters, and cookies, data streaming, and dealing with exceptions raised by a request, among other topics.</p>
+<% end %>
+
+<%= guide("Rails Routing from the Outside In", 'routing.html') do %>
+ <p>This guide covers the user-facing features of Rails routing. If you want to understand how to use routing in your own Rails applications, start here.</p>
+<% end %>
+</dl>
+
+<h3>Digging Deeper</h3>
+
+<dl>
+
+<%= guide("Rails on Rack", 'rails_on_rack.html') do %>
+ <p>This guide covers Rails integration with Rack and interfacing with other Rack components.</p>
+<% end %>
+
+<%= guide("Rails Internationalization API", 'i18n.html') do %>
+ <p>This guide covers how to add internationalization to your applications. Your application will be able to translate content to different languages, change pluralization rules, use correct date formats for each country and so on.</p>
+<% end %>
+
+<%= guide("Action Mailer Basics", 'action_mailer_basics.html', :ticket => 25) do %>
+ <p>This guide describes how to use Action Mailer to send and receive emails.</p>
+<% end %>
+
+<%= guide("Testing Rails Applications", 'testing.html', :ticket => 8) do %>
+ <p>This is a rather comprehensive guide to doing both unit and functional tests in Rails. It covers everything from &quot;What is a test?&quot; to the testing APIs. Enjoy.</p>
+<% end %>
+
+<%= guide("Securing Rails Applications", 'security.html') do %>
+ <p>This guide describes common security problems in web applications and how to avoid them with Rails.</p>
+<% end %>
+
+<%= guide("Debugging Rails Applications", 'debugging_rails_applications.html') do %>
+ <p>This guide describes how to debug Rails applications. It covers the different ways of achieving this and how to understand what is happening "behind the scenes" of your code.</p>
+<% end %>
+
+<%= guide("Performance Testing Rails Applications", 'performance_testing.html') do %>
+ <p>This guide covers the various ways of performance testing a Ruby on Rails application.</p>
+<% end %>
+
+<%= guide("The Basics of Creating Rails Plugins", 'plugins.html', :ticket => 32) do %>
+ <p>This guide covers how to build a plugin to extend the functionality of Rails.</p>
+<% end %>
+
+<%= guide("Configuring Rails Applications", 'configuring.html') do %>
+ <p>This guide covers the basic configuration settings for a Rails application.</p>
+<% end %>
+
+<%= guide("Rails Command Line Tools and Rake tasks", 'command_line.html', :ticket => 29) do %>
+ <p>This guide covers the command line tools and rake tasks provided by Rails.</p>
+<% end %>
+
+<%= guide("Caching with Rails", 'caching_with_rails.html', :ticket => 10) do %>
+ <p>Various caching techniques provided by Rails.</p>
+<% end %>
+
+<%= guide("Contributing to Rails", 'contributing_to_rails.html') do %>
+ <p>Rails is not &quot;somebody else's framework.&quot; This guide covers a variety of ways that you can get involved in the ongoing development of Rails.</p>
+<% end %>
+</dl>
+
+<h3>Release Notes</h3>
+
+<dl>
+<%= guide("Ruby on Rails 3.0 Release Notes", '3_0_release_notes.html') do %>
+ <p>Release notes for Rails 3.0.</p>
+<% end %>
+
+<%= guide("Ruby on Rails 2.3 Release Notes", '2_3_release_notes.html') do %>
+ <p>Release notes for Rails 2.3.</p>
+<% end %>
+
+<%= guide("Ruby on Rails 2.2 Release Notes", '2_2_release_notes.html') do %>
+ <p>Release notes for Rails 2.2.</p>
+<% end %>
+</dl>
diff --git a/railties/guides/source/index.textile.erb b/railties/guides/source/index.textile.erb
deleted file mode 100644
index 538fe48a38..0000000000
--- a/railties/guides/source/index.textile.erb
+++ /dev/null
@@ -1,139 +0,0 @@
-<% content_for :header_section do %>
-h2. Ruby on Rails Guides
-
-These guides are designed to make you immediately productive with Rails, and to help you understand how all of the pieces fit together. There are two different versions of the Guides site, and you should be sure to use the one that applies to your situation:
-
-* "Current Release version":http://guides.rubyonrails.org - based on Rails 2.3
-* "Edge version":http://edgeguides.rubyonrails.org - based on the current Rails "master branch":http://github.com/rails/rails/tree/master
-
-<% end %>
-
-<% content_for :index_section do %>
-<div id="subCol">
- <dl>
- <dd class="warning">Rails Guides are a result of the ongoing "Guides hackfest":http://hackfest.rubyonrails.org and a work in progress.</dd>
- <dd class="ticket">Guides marked with this icon are currently being worked on. While they might still be useful to you, they may contain incomplete information and even errors. You can help by reviewing them and posting your comments and corrections at the respective Lighthouse ticket.</dd>
- </dl>
-</div>
-<% end %>
-
-h3. Start Here
-
-<dl>
-<%= guide('Getting Started with Rails', 'getting_started.html') do %>
- Everything you need to know to install Rails and create your first application.
-<% end %>
-</dl>
-
-h3. Models
-
-<dl>
-<%= guide("Rails Database Migrations", 'migrations.html') do %>
- This guide covers how you can use Active Record migrations to alter your database in a structured and organized manner.
-<% end %>
-
-<%= guide("Active Record Validations and Callbacks", 'activerecord_validations_callbacks.html') do %>
- This guide covers how you can use Active Record validations and callbacks.
-<% end %>
-
-<%= guide("Active Record Associations", 'association_basics.html') do %>
- This guide covers all the associations provided by Active Record.
-<% end %>
-
-<%= guide("Active Record Query Interface", 'active_record_querying.html') do %>
- This guide covers the database query interface provided by Active Record.
-<% end %>
-</dl>
-
-h3. Views
-
-<dl>
-<%= guide("Layouts and Rendering in Rails", 'layouts_and_rendering.html') do %>
- This guide covers the basic layout features of Action Controller and Action View, including rendering and redirecting, using content_for blocks, and working with partials.
-<% end %>
-
-<%= guide("Action View Form Helpers", 'form_helpers.html', :ticket => 1) do %>
- Guide to using built in Form helpers.
-<% end %>
-</dl>
-
-h3. Controllers
-
-<dl>
-<%= guide("Action Controller Overview", 'action_controller_overview.html') do %>
- This guide covers how controllers work and how they fit into the request cycle in your application. It includes sessions, filters, and cookies, data streaming, and dealing with exceptions raised by a request, among other topics.
-<% end %>
-
-<%= guide("Rails Routing from the Outside In", 'routing.html') do %>
- This guide covers the user-facing features of Rails routing. If you want to understand how to use routing in your own Rails applications, start here.
-<% end %>
-</dl>
-
-h3. Digging Deeper
-
-<dl>
-
-<%= guide("Rails on Rack", 'rails_on_rack.html') do %>
- This guide covers Rails integration with Rack and interfacing with other Rack components.
-<% end %>
-
-<%= guide("Rails Internationalization API", 'i18n.html') do %>
- This guide covers how to add internationalization to your applications. Your application will be able to translate content to different languages, change pluralization rules, use correct date formats for each country and so on.
-<% end %>
-
-<%= guide("Action Mailer Basics", 'action_mailer_basics.html', :ticket => 25) do %>
- This guide describes how to use Action Mailer to send and receive emails.
-<% end %>
-
-<%= guide("Testing Rails Applications", 'testing.html', :ticket => 8) do %>
- This is a rather comprehensive guide to doing both unit and functional tests in Rails. It covers everything from “What is a test?” to the testing APIs. Enjoy.
-<% end %>
-
-<%= guide("Securing Rails Applications", 'security.html') do %>
- This guide describes common security problems in web applications and how to avoid them with Rails.
-<% end %>
-
-<%= guide("Debugging Rails Applications", 'debugging_rails_applications.html') do %>
- This guide describes how to debug Rails applications. It covers the different ways of achieving this and how to understand what is happening "behind the scenes" of your code.
-<% end %>
-
-<%= guide("Performance Testing Rails Applications", 'performance_testing.html') do %>
- This guide covers the various ways of performance testing a Ruby on Rails application.
-<% end %>
-
-<%= guide("The Basics of Creating Rails Plugins", 'plugins.html', :ticket => 32) do %>
- This guide covers how to build a plugin to extend the functionality of Rails.
-<% end %>
-
-<%= guide("Configuring Rails Applications", 'configuring.html') do %>
- This guide covers the basic configuration settings for a Rails application.
-<% end %>
-
-<%= guide("Rails Command Line Tools and Rake tasks", 'command_line.html', :ticket => 29) do %>
- This guide covers the command line tools and rake tasks provided by Rails.
-<% end %>
-
-<%= guide("Caching with Rails", 'caching_with_rails.html', :ticket => 10) do %>
- Various caching techniques provided by Rails.
-<% end %>
-
-<%= guide("Contributing to Rails", 'contributing_to_rails.html') do %>
- Rails is not "somebody else's framework." This guide covers a variety of ways that you can get involved in the ongoing development of Rails.
-<% end %>
-</dl>
-
-h3. Release Notes
-
-<dl>
-<%= guide("Ruby on Rails 3.0 Release Notes", '3_0_release_notes.html') do %>
- Release notes for Rails 3.0.
-<% end %>
-
-<%= guide("Ruby on Rails 2.3 Release Notes", '2_3_release_notes.html') do %>
- Release notes for Rails 2.3.
-<% end %>
-
-<%= guide("Ruby on Rails 2.2 Release Notes", '2_2_release_notes.html') do %>
- Release notes for Rails 2.2.
-<% end %>
-</dl>
diff --git a/railties/guides/source/layout.html.erb b/railties/guides/source/layout.html.erb
index a21f1bbeed..b280101d25 100644
--- a/railties/guides/source/layout.html.erb
+++ b/railties/guides/source/layout.html.erb
@@ -1,19 +1,27 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<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">
+ <% if @edge %>
+ <div>
+ <img src="images/edge_badge.png" alt="edge-badge" id="edge-badge" />
+ </div>
+ <% end %>
<div id="topNav">
<div class="wrapper">
<strong>More at <a href="http://rubyonrails.org/">rubyonrails.org:</a> </strong>
@@ -101,7 +109,7 @@
<hr class="hide" />
<div id="footer">
<div class="wrapper">
- <p>This work is licensed under a <a href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-Share Alike 3.0</a> License</a></p>
+ <p>This work is licensed under a <a href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-Share Alike 3.0</a> License</p>
<p>"Rails", "Ruby on Rails", and the Rails logo are trademarks of David Heinemeier Hansson. All rights reserved.</p>
</div>
</div>
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 8cf084494b..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:
@@ -79,7 +79,7 @@ If you're coming from Rails 2, this route will be equivalent to:
map.login '/login', :controller => 'sessions', :action => 'new'
</ruby>
-You will also notice that +sessions#new+ is a shorthand for +:controller => 'sessions', :action => 'new'+. By declaring a named route such as this, you can use +login_path+ or +login_url+ in your controllers and views to generate the URLs for this route.
+You will also notice that +sessions#new+ is a shorthand for +:controller => 'sessions', :action => 'new'+. By declaring a named route such as this, you can use +login_path+ or +login_url+ in your controllers and views to generate the URLs for this route. A RESTful generates named routes without the need to explicitly generate a named route via +as+ key.
h4. Nested Routes
@@ -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,
@@ -215,8 +215,7 @@ Although the conventions of RESTful routing are likely to be sufficient for many
* +:controller+
* +:singular+
-* +:requirements+
-* +:conditions+
+* +:constraints+
* +:as+
* +:path_names+
* +:only+
@@ -257,13 +256,7 @@ If you use controller namespaces, you need to be aware of a subtlety in the Rail
TIP: If you want to guarantee that a link goes to a top-level controller, use a preceding slash to anchor the controller name: +&lt;%= link_to "show", {:controller => "/photos", :action => "show"} %&gt;+
-You can also specify a controller namespace with the +:namespace+ option instead of a path:
-
-<ruby>
-resources :adminphotos, :namespace => "admin", :controller => "photos"
-</ruby>
-
-This can be especially useful when map multiple namespaced routes together using +namespace+ block by:
+You can also specify a controller namespace with the +namespace+ method instead of a path. This can be especially useful when mapping multiple namespaced routes together:
<ruby>
namespace :admin do
@@ -285,20 +278,16 @@ resources :teeth, :singular => "tooth"
TIP: Depending on the other code in your application, you may prefer to add additional rules to the +Inflector+ class instead.
-h5. Using +:requirements+
+h5. Using +:constraints+
-You can use the +:requirements+ option in a RESTful route to impose a format on the implied +:id+ parameter in the singular routes. For example:
+You can use the +:constraints+ option in a RESTful route to impose a format on the implied parameter in routes. For example:
<ruby>
-resources :photos, :requirements => {:id => /[A-Z][A-Z][0-9]+/}
+resources :photos, :constraints => {:id => /[A-Z][A-Z][0-9]+/}
</ruby>
This declaration constrains the +:id+ parameter to match the supplied regular expression. So, in this case, +/photos/1+ would no longer be recognized by this route, but +/photos/RR27+ would.
-h5. Using +:conditions+
-
-Conditions in Rails routing are currently used only to set the HTTP verb for individual routes. Although in theory you can set this for RESTful routes, in practice there is no good reason to do so. (You'll learn more about conditions in the discussion of classic routing later in this guide.)
-
h5. Using +:as+
The +:as+ option lets you override the normal naming for the actual generated paths. For example:
@@ -343,37 +332,15 @@ TIP: If you find yourself wanting to change this option uniformly for all of you
config.action_controller.resources_path_names = { :new => 'make', :edit => 'change' }
</ruby>
-h5. Using +:path_prefix+
-
-The +:path_prefix+ option lets you add additional parameters that will be prefixed to the recognized paths. For example, suppose each photo in your application belongs to a particular photographer. In that case, you might declare this route:
-
-<ruby>
-resources :photos, :path_prefix => '/photographers/:photographer_id'
-</ruby>
-
-Routes recognized by this entry would include:
-
-<pre>
-/photographers/1/photos/2
-/photographers/1/photos
-</pre>
-
-NOTE: In most cases, it's simpler to recognize URLs of this sort by creating nested resources, as discussed in the next section.
-
-NOTE: You can also use +:path_prefix+ with non-RESTful routes.
-
h5. Using +:name_prefix+
You can use the :name_prefix option to avoid collisions between routes. This is most useful when you have two resources with the same name that use +:path_prefix+ to map differently. For example:
<ruby>
-resources :photos, :path_prefix => '/photographers/:photographer_id',
- :name_prefix => 'photographer_'
-resources :photos, :path_prefix => '/agencies/:agency_id',
- :name_prefix => 'agency_'
+resources :photos :name_prefix => 'photographer'
</ruby>
-This combination will give you route helpers such as +photographer_photos_path+ and +agency_edit_photo_path+ to use in your code.
+This combination will give you route helpers such as +photographer_photos_path+ to use in your code.
NOTE: You can also use +:name_prefix+ with non-RESTful routes.
@@ -395,8 +362,6 @@ resources :photos, :except => :destroy
In this case, all of the normal routes except the route for +destroy+ (a +DELETE+ request to +/photos/<em>id</em>+) will be generated.
-In addition to an action or a list of actions, you can also supply the special symbols +:all+ or +:none+ to the +:only+ and +:except+ options.
-
TIP: If your application has many RESTful routes, using +:only+ and +:except+ to generate only the routes that you actually need can cut down on memory use and speed up the routing process.
h4. Nested Resources
@@ -421,8 +386,6 @@ resources :magazines do
end
</ruby>
-TIP: Further below you'll learn about a convenient shortcut for this construct:<br/>+resources :magazines, :has_many => :ads+
-
In addition to the routes for magazines, this declaration will also create routes for ads, each of which requires the specification of a magazine in the URL:
|_.HTTP verb|_.URL |_.controller|_.action |_.used for|
@@ -437,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,
@@ -447,38 +410,7 @@ resources :magazines do
end
</ruby>
-This will create routing helpers such as +periodical_ads_url+ and +periodical_edit_ad_path+. You can even use +:name_prefix+ to suppress the prefix entirely:
-
-<ruby>
-resources :magazines do
- resources :ads, :name_prefix => nil
-end
-</ruby>
-
-This will create routing helpers such as +ads_url+ and +edit_ad_path+. Note that calling these will still require supplying an article id:
-
-<ruby>
-ads_url(@magazine)
-edit_ad_path(@magazine, @ad)
-</ruby>
-
-h5. Using +:has_one+ and +:has_many+
-
-The +:has_one+ and +:has_many+ options provide a succinct notation for simple nested routes. Use +:has_one+ to nest a singleton resource, or +:has_many+ to nest a plural resource:
-
-<ruby>
-resources :photos, :has_one => :photographer, :has_many => [:publications, :versions]
-</ruby>
-
-This has the same effect as this set of declarations:
-
-<ruby>
-resources :photos do
- resource :photographer
- resources :publications
- resources :versions
-end
-</ruby>
+This will create routing helpers such as +periodical_ads_url+ and +periodical_edit_ad_path+.
h5. Limits to Nesting
@@ -492,7 +424,7 @@ resources :publishers do
end
</ruby>
-However, without the use of +name_prefix => nil+, deeply-nested resources quickly become cumbersome. In this case, for example, the application would recognize URLs such as
+Deeply-nested resources quickly become cumbersome. In this case, for example, the application would recognize URLs such as
<pre>
/publishers/1/magazines/2/photos/3
@@ -524,11 +456,7 @@ This will enable recognition of (among others) these routes:
/photos/3 ==> photo_path(3)
</pre>
-With shallow nesting, you need only supply enough information to uniquely identify the resource that you want to work with. If you like, you can combine shallow nesting with the +:has_one+ and +:has_many+ options:
-
-<ruby>
-resources :publishers, :has_many => { :magazines => :photos }, :shallow => true
-</ruby>
+With shallow nesting, you need only supply enough information to uniquely identify the resource that you want to work with.
h4. Route Generation from Arrays
@@ -556,19 +484,25 @@ This format is especially useful when you might not know until runtime which of
h4. Namespaced Resources
-It's possible to do some quite complex things by combining +:path_prefix+ and +:name_prefix+. For example, you can use the combination of these two options to move administrative resources to their own folder in your application:
+It's possible to do some quite complex things by combining +scope+ and +:name_prefix+. For example, you can use the combination of these two options to move administrative resources to their own folder in your application:
<ruby>
-resources :photos, :path_prefix => 'admin', :controller => 'admin/photos'
-resources :tags, :name_prefix => 'admin_photo_', :path_prefix => 'admin/photos/:photo_id', :controller => 'admin/photo_tags'
-resources :ratings, :name_prefix => 'admin_photo_', :path_prefix => 'admin/photos/:photo_id', :controller => 'admin/photo_ratings'
+scope 'admin' do
+ resources :photos, :name_prefix => "admin", :controller => 'admin/photos'
+ scope 'photos' do
+ resources :tags, :name_prefix => 'admin_photo', :controller => 'admin/photo_tags'
+ resources :ratings, :name_prefix => 'admin_photo', :controller => 'admin/photo_ratings'
+ end
+end
</ruby>
The good news is that if you find yourself using this level of complexity, you can stop. Rails supports _namespaced resources_ to make placing resources in their own folder a snap. Here's the namespaced version of those same three routes:
<ruby>
namespace :admin do
- resources :photos, :has_many => { :tags, :ratings }
+ resources :photos do
+ resources :tags, :ratings
+ end
end
</ruby>
@@ -592,7 +526,7 @@ end
This will enable Rails to recognize URLs such as +/photos/1/preview+ using the GET HTTP verb, and route them to the preview action of the Photos controller. It will also create the +preview_photo_url+ and +preview_photo_path+ route helpers.
-Within the block of member routes, each route name specifies the HTTP verb that it will recognize. You can use +get+, +put+, +post+, +delete+, or +any+ here. If you don't have multiple +member+ route, you can also passing +:on+ to the routing.
+Within the block of member routes, each route name specifies the HTTP verb that it will recognize. You can use +get+, +put+, +post+, or +delete+ here. If you don't have multiple +member+ route, you can also passing +:on+ to the routing.
<ruby>
resources :photos do
@@ -649,7 +583,7 @@ When you set up a regular route, you supply a series of symbols that Rails maps
match ':controller(/:action(/:id))'
</ruby>
-If an incoming request of +/photos/show/1+ is processed by this route (because it hasn't matched any previous route in the file), then the result will be to invoke the +show+ action of the +Photos+ controller, and to make the final parameter (1) available as +params[:id]+.
+If an incoming request of +/photos/show/1+ is processed by this route (because it hasn't matched any previous route in the file), then the result will be to invoke the +show+ action of the +Photos+ controller, and to make the final parameter (1) available as +params[:id]+. This route will also route the incoming request of +/photos+ to PhotosController, since +:action+ and +:id+ are optional parameters, denoted by parenthesis.
h4. Wildcard Components
@@ -709,12 +643,12 @@ match 'logout' => 'sessions#destroy', :as => :logout
This will do two things. First, requests to +/logout+ will be sent to the +destroy+ action of the +Sessions+ controller. Second, Rails will maintain the +logout_path+ and +logout_url+ helpers for use within your code.
-h4. Route Requirements
+h4. Route Constraints
-You can use the +:requirements+ option to enforce a format for any parameter in a route:
+You can use the +:constraints+ option to enforce a format for any parameter in a route:
<ruby>
-match 'photo/:id' => 'photos#show', :requirements => { :id => /[A-Z]\d{5}/ }
+match 'photo/:id' => 'photos#show', :constraints => { :id => /[A-Z]\d{5}/ }
</ruby>
This route would respond to URLs such as +/photo/A12345+. You can more succinctly express the same route this way:
@@ -723,16 +657,6 @@ This route would respond to URLs such as +/photo/A12345+. You can more succinctl
match 'photo/:id' => 'photos#show', :id => /[A-Z]\d{5}/
</ruby>
-h4. Route Conditions
-
-Route conditions (introduced with the +:conditions+ option) are designed to implement restrictions on routes. Currently, the only supported restriction is +:method+:
-
-<ruby>
-match 'photo/:id' => 'photos#show', :conditions => { :method => :get }
-</ruby>
-
-As with conditions in RESTful routes, you can specify +:get+, +:post+, +:put+, +:delete+, or +:any+ for the acceptable method.
-
h4. Route Globbing
Route globbing is a way to specify that a particular parameter should be matched to all the remaining parts of a route. For example
@@ -743,20 +667,6 @@ match 'photo/*other' => 'photos#unknown'
This route would match +photo/12+ or +/photo/long/path/to/12+ equally well, creating an array of path segments as the value of +params[:other]+.
-h4. Route Options
-
-You can use +:with_options+ to simplify defining groups of similar routes:
-
-<ruby>
-map.with_options :controller => 'photo' do |photo|
- photo.list '', :action => 'index'
- photo.delete ':id/delete', :action => 'delete'
- photo.edit ':id/edit', :action => 'edit'
-end
-</ruby>
-
-The importance of +map.with_options+ has declined with the introduction of RESTful routes.
-
h3. Formats and +respond_to+
There's one more way in which routing can do different things depending on differences in the incoming HTTP request: by issuing a response that corresponds to what the request specifies that it will accept. In Rails routing, you can control this with the special +:format+ parameter in the route.
@@ -899,6 +809,7 @@ h3. Changelog
"Lighthouse ticket":http://rails.lighthouseapp.com/projects/16213-rails-guides/tickets/3
+* April 2, 2010: Updated guide to match new Routing DSL in Rails 3, by Rizwan Reza
* Febuary 1, 2010: Modifies the routing documentation to match new routing DSL in Rails 3, by Prem Sichanugrist
* October 4, 2008: Added additional detail on specifying verbs for resource member/collection routes, by "Mike Gunderloy":credits.html#mgunderloy
* September 23, 2008: Added section on namespaced controllers and routing, by "Mike Gunderloy":credits.html#mgunderloy
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)