From 8fa3183436cedd7248b47b4aa1fda86e77396c9a Mon Sep 17 00:00:00 2001 From: Jaime Iniesta Date: Sun, 4 Apr 2010 11:06:16 +0200 Subject: Fixed layouts_and_rendering guide so that it validates XHTML 1.0 Strict --- railties/guides/source/layouts_and_rendering.textile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'railties/guides/source') diff --git a/railties/guides/source/layouts_and_rendering.textile b/railties/guides/source/layouts_and_rendering.textile index 2cb98e9ee6..1ddba807e0 100644 --- a/railties/guides/source/layouts_and_rendering.textile +++ b/railties/guides/source/layouts_and_rendering.textile @@ -510,7 +510,7 @@ def show end -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 +&& 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 ++ 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 +<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+: <%= stylesheet_link_tag "main" %> -- cgit v1.2.3 From 8f5c3e5b6a7bb456b669f1b207fc5a7d782dceb6 Mon Sep 17 00:00:00 2001 From: Jaime Iniesta Date: Sun, 4 Apr 2010 11:28:25 +0200 Subject: Fixing credits page so that it validates XHTML 1.0 Strict and adding myself to it --- railties/guides/source/credits.html.erb | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'railties/guides/source') diff --git a/railties/guides/source/credits.html.erb b/railties/guides/source/credits.html.erb index e026628e6a..0f203765ac 100644 --- a/railties/guides/source/credits.html.erb +++ b/railties/guides/source/credits.html.erb @@ -8,53 +8,57 @@

Rails Documentation Team

<%= author('Mike Gunderloy', 'mgunderloy') do %> -

Mike Gunderloy is a consultant with ActionRails. 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 and he twitters too much.

+ Mike Gunderloy is a consultant with ActionRails. 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 and he twitters too much. <% end %> <%= author('Pratik Naik', 'lifo') do %> -

Pratik Naik is a Ruby on Rails consultant with ActionRails and also a member of the Rails core team. He maintains a blog at has_many :bugs, :through => :rails and has an active twitter account.

+ Pratik Naik is a Ruby on Rails consultant with ActionRails and also a member of the Rails core team. He maintains a blog at has_many :bugs, :through => :rails and has an active twitter account. <% 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 tweets and can be found everywhere as "fxn".

+ 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 tweets and can be found everywhere as "fxn". <% end %>

Rails Guides Designers

<%= 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 Thinkcage.com or follow him on Twitter.

+ 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 Thinkcage.com or follow him on Twitter. <% end %>

Rails Guides Authors

<%= 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.

+ 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. <% 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.

+ 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. <% end %> <%= author('Jeff Dean', 'zilkey') do %> -

Jeff Dean is a software engineer with Pivotal Labs.

+ Jeff Dean is a software engineer with Pivotal Labs. <% 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 */, which is mainly written in Portuguese, but will soon get a new section for posts with English translation. + Cássio Marques is a Brazilian software developer working with different programming languages such as Ruby, JavaScript, CPP and Java, as an independent consultant. He blogs at /* CODIFICANDO */, 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 in San Diego, CA. Find me on GitHub, Gmail, Twitter, and Freenode as "bensie".

+ James Miller is a software developer for JK Tech 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. He has been using Rails since 2006 and contributing since early 2008. Can be found at gmail, twitter, freenode, everywhere as "miloops".

+ Emilio Tagua —a.k.a. miloops— is an Argentinian entrepreneur, developer, open source contributor and Rails evangelist. Cofounder of Eventioz. 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, a German web application security consulting and development company focused on Ruby on Rails. He blogs at the Ruby on Rails Security Project. After 10 years of desktop application development, Heiko has rarely looked back.

+ Heiko Webers is the founder of bauland42, a German web application security consulting and development company focused on Ruby on Rails. He blogs at the Ruby on Rails Security Project. 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 blog and tweets. + 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 blog and tweets. +<% end %> + +<%= author('Jaime Iniesta', 'jaimeiniesta', 'jaimeiniesta.jpg') do %> + Jaime Iniesta works as a Ruby on Rails freelance developer since 2005. He's a member of ProRuby, co-founder of the Spanish Ruby Users Group, member of Spain.rb, and organizer of Conferencia Rails and EuRuKo 2009. Jaime has a blog and tweets. <% end %> -- cgit v1.2.3 From ac8b71cc2032bd352cbe6c078bdff55b236cab8a Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sun, 4 Apr 2010 02:30:31 -0700 Subject: guides assets are now centralized in the assets directory, with standard subdirs --- railties/guides/source/contribute.textile | 2 +- railties/guides/source/layout.html.erb | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'railties/guides/source') 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/layout.html.erb b/railties/guides/source/layout.html.erb index 9819db1f89..b280101d25 100644 --- a/railties/guides/source/layout.html.erb +++ b/railties/guides/source/layout.html.erb @@ -7,13 +7,13 @@ <%= yield(:page_title) || 'Ruby on Rails guides' %> - - - + + + - - - + + + -- cgit v1.2.3 From 96b70229d681006ce4b169541845935bc067e294 Mon Sep 17 00:00:00 2001 From: Jaime Iniesta Date: Sun, 4 Apr 2010 11:44:54 +0200 Subject: Updated changelog on getting_started and layouts_and_rendering --- railties/guides/source/getting_started.textile | 1 + railties/guides/source/layouts_and_rendering.textile | 1 + 2 files changed, 2 insertions(+) (limited to 'railties/guides/source') diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile index 9cc96f8205..9669f7f155 100644 --- a/railties/guides/source/getting_started.textile +++ b/railties/guides/source/getting_started.textile @@ -1432,6 +1432,7 @@ h3. Changelog "Lighthouse ticket":http://rails.lighthouseapp.com/projects/16213-rails-guides/tickets/2 +* April 1, 2010: Fixed document to validate XHTML 1.0 Strict. "Jaime Iniesta":credits.html#jaimeiniesta * February 8, 2010: Full re-write for Rails 3.0-beta, added helpers and before_filters, refactored code by "Mikel Lindsaar":credits:html#raasdnil * January 24, 2010: Re-write for Rails 3.0 by "Mikel Lindsaar":credits:html#raasdnil * July 18, 2009: Minor cleanup in anticipation of Rails 2.3.3 by "Mike Gunderloy":credits.html#mgunderloy diff --git a/railties/guides/source/layouts_and_rendering.textile b/railties/guides/source/layouts_and_rendering.textile index 1ddba807e0..d9781fc966 100644 --- a/railties/guides/source/layouts_and_rendering.textile +++ b/railties/guides/source/layouts_and_rendering.textile @@ -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 -- cgit v1.2.3 From be72a397f809360b5158db0b32429bf82593ceb5 Mon Sep 17 00:00:00 2001 From: Jaime Iniesta Date: Sun, 4 Apr 2010 11:48:10 +0200 Subject: Added 'Rails Guides Reviewers' section to credits --- railties/guides/source/credits.html.erb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'railties/guides/source') diff --git a/railties/guides/source/credits.html.erb b/railties/guides/source/credits.html.erb index 0f203765ac..9851702df9 100644 --- a/railties/guides/source/credits.html.erb +++ b/railties/guides/source/credits.html.erb @@ -59,6 +59,8 @@ 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 blog and tweets. <% end %> +

Rails Guides Reviewers

+ <%= author('Jaime Iniesta', 'jaimeiniesta', 'jaimeiniesta.jpg') do %> Jaime Iniesta works as a Ruby on Rails freelance developer since 2005. He's a member of ProRuby, co-founder of the Spanish Ruby Users Group, member of Spain.rb, and organizer of Conferencia Rails and EuRuKo 2009. Jaime has a blog and tweets. <% end %> -- cgit v1.2.3 From af87232342b1bc82b45e2ac34e926753ca03d525 Mon Sep 17 00:00:00 2001 From: Jaime Iniesta Date: Sun, 4 Apr 2010 12:09:09 +0200 Subject: Fix testing guide so that it validates XHTML 1.0 Strict --- railties/guides/source/testing.textile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'railties/guides/source') 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, &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) -- cgit v1.2.3 From 395f171141e50b99516d445198a44afc12bd65ea Mon Sep 17 00:00:00 2001 From: Jaime Iniesta Date: Sun, 4 Apr 2010 12:21:32 +0200 Subject: Fixed debugging guide to pass XHTML 1.0 Strict --- railties/guides/source/debugging_rails_applications.textile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'railties/guides/source') 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 -TIP: To view the help menu for any command use +help + in active debug mode. For example: _+help var+_ +TIP: To view the help menu for any command use +help <command-name>+ 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 -- cgit v1.2.3 From 62fd691a7a5c90b5a56b5b8be399482fdd89928e Mon Sep 17 00:00:00 2001 From: Jaime Iniesta Date: Sun, 4 Apr 2010 12:33:28 +0200 Subject: Fix XHTML on performance guide --- railties/guides/source/performance_testing.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/guides/source') diff --git a/railties/guides/source/performance_testing.textile b/railties/guides/source/performance_testing.textile index 5c760a5966..154dbbbbe6 100644 --- a/railties/guides/source/performance_testing.textile +++ b/railties/guides/source/performance_testing.textile @@ -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 ++ 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 +<homedir>+ with a full patch to your actual home directory. [lifo@null ruby-version]$ ./configure --prefix=//rubygc -- cgit v1.2.3 From a6dc000158e806c1e82ee4af5e5c2e43e5f0493f Mon Sep 17 00:00:00 2001 From: Jaime Iniesta Date: Sun, 4 Apr 2010 12:43:19 +0200 Subject: Replace
 by ,  and  on plugins guide; making
 it validate XHTML 1.0 Strict

---
 railties/guides/source/plugins.textile | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

(limited to 'railties/guides/source')

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:
 
-
+
 gem install rails
 rails yaffle_guide
 cd yaffle_guide
 rails generate scaffold bird name:string
 rake db:migrate
 rails server
-
+
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: -
+
 rails generate plugin yaffle
 rails generate plugin yaffle --with-generator
-
+ 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: -
+
 rails generate plugin yaffle --with-generator
-
+ You should see the following output: -
+
 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
-
+ 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: -
+
 |-- lib
 |   |-- yaffle
 |   `-- yaffle.rb
 `-- rails
     |
     `-- init.rb
-
+ *vendor/plugins/yaffle/init.rb* @@ -124,7 +124,7 @@ h4. Test Setup *vendor/plugins/yaffle/test/database.yml:* -
+
 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
-
+ 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+: -
+
 cd vendor/plugins/yaffle
 rake
-
+ 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 -- cgit v1.2.3 From 7d7e0627a0490b6b4ddb0ee5429264ccd46f1245 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sun, 4 Apr 2010 08:42:54 -0700 Subject: fixes duplicate element IDs in some guides --- railties/guides/source/action_view_overview.textile | 2 +- railties/guides/source/active_support_core_extensions.textile | 6 +++--- railties/guides/source/form_helpers.textile | 2 +- railties/guides/source/performance_testing.textile | 6 +++--- railties/guides/source/routing.textile | 6 +++--- railties/guides/source/security.textile | 10 +++++----- 6 files changed, 16 insertions(+), 16 deletions(-) (limited to 'railties/guides/source') diff --git a/railties/guides/source/action_view_overview.textile b/railties/guides/source/action_view_overview.textile index 2fa89bb4c2..842a8408ad 100644 --- a/railties/guides/source/action_view_overview.textile +++ b/railties/guides/source/action_view_overview.textile @@ -1414,7 +1414,7 @@ Replaces the inner HTML of the DOM element with the given id. page.replace_html 'person-45', :partial => 'person', :object => @person -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/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/performance_testing.textile b/railties/guides/source/performance_testing.textile index 154dbbbbe6..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 -h5. Profiling +h5(#output-profiling). Profiling In profiling mode, you can choose from four types of output. diff --git a/railties/guides/source/routing.textile b/railties/guides/source/routing.textile index 6625412684..0cf8c45761 100644 --- a/railties/guides/source/routing.textile +++ b/railties/guides/source/routing.textile @@ -65,7 +65,7 @@ RESTful routes take advantage of the built-in REST orientation of Rails to wrap resources :books -h4. Named Routes +h4(#quick-tour-named-routes). Named Routes Named routes give you very readable links in your code, as well as handling incoming requests. Here's a typical named route: @@ -91,7 +91,7 @@ resources :assemblies do end -h4. Regular Routes +h4(#quick-tour-regular-routes). Regular Routes In many applications, you'll also see non-RESTful routing, which explicitly connects the parts of a URL to a particular action. For example, @@ -400,7 +400,7 @@ In addition to the routes for magazines, this declaration will also create route This will also create routing helpers such as +magazine_ads_url+ and +edit_magazine_ad_path+. -h5. Using +:name_prefix+ +h5(#nested-name-prefix). Using +:name_prefix+ The +:name_prefix+ option overrides the automatically-generated prefix in nested route helpers. For example, diff --git a/railties/guides/source/security.textile b/railties/guides/source/security.textile index b62ff8cb38..1ddf094d18 100644 --- a/railties/guides/source/security.textile +++ b/railties/guides/source/security.textile @@ -611,7 +611,7 @@ h4. SQL Injection -- _Thanks to clever methods, this is hardly a problem in most Rails applications. However, this is a very devastating and common attack in web applications, so it is important to understand the problem._ -h5. Introduction +h5(#sql-injection-introduction). Introduction SQL injection attacks aim at influencing database queries by manipulating web application parameters. A popular goal of SQL injection attacks is to bypass authorization. Another goal is to carry out data manipulation or reading arbitrary data. Here is an example of how not to use user input data in a query: @@ -668,7 +668,7 @@ The result won't be a list of projects (because there is no project with an empt Also, the second query renames some columns with the AS statement so that the web application displays the values from the user table. Be sure to update your Rails "to at least 2.1.1":http://www.rorsecurity.info/2008/09/08/sql-injection-issue-in-limit-and-offset-parameter/. -h5. Countermeasures +h5(#sql-injection-countermeasures). Countermeasures Ruby on Rails has a built in filter for special SQL characters, which will escape ' , " , NULL character and line breaks. Using +Model.find(id)+ or +Model.find_by_some thing(something)+ automatically applies this countermeasure. But in SQL fragments, especially in conditions fragments (+:conditions => "..."+), the +connection.execute()+ or +Model.find_by_sql()+ methods, it has to be applied manually. @@ -760,7 +760,7 @@ http://www.cbsnews.com/stories/2002/02/15/weather_local/main501644.shtml?zipcode