From 0da0aa4cd9fc5f9d02a6afd78115551b4485dcb9 Mon Sep 17 00:00:00 2001 From: Rajinder Yadav Date: Sun, 3 Oct 2010 20:41:56 -0400 Subject: corrected wording for better reading, fixed ugly intented quote by using code tags --- railties/guides/source/form_helpers.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/railties/guides/source/form_helpers.textile b/railties/guides/source/form_helpers.textile index ce0f66b2c1..b795d126e6 100644 --- a/railties/guides/source/form_helpers.textile +++ b/railties/guides/source/form_helpers.textile @@ -67,7 +67,7 @@ A basic search form <% end %> -TIP: +search_path+ can be a named route specified in "routes.rb":
map.search "search", :controller => "search" +TIP: +search_path+ can be a named route specified in "routes.rb" as:
match "search" => "search"This declares for path "/search" to call action "search" from controller "search". The above view code will result in the following markup: -- cgit v1.2.3 From 018bf0f5756ef3887815ea46d6671dc1d3b526cf Mon Sep 17 00:00:00 2001 From: Rajinder Yadav Date: Mon, 4 Oct 2010 00:02:09 -0400 Subject: added more items to the set to improve explanation of validates_exclusion_of --- railties/guides/source/active_record_validations_callbacks.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/railties/guides/source/active_record_validations_callbacks.textile b/railties/guides/source/active_record_validations_callbacks.textile index a8ccfc7e40..a9d66c0a06 100644 --- a/railties/guides/source/active_record_validations_callbacks.textile +++ b/railties/guides/source/active_record_validations_callbacks.textile @@ -235,7 +235,7 @@ This helper validates that the attributes' values are not included in a given se class Account < ActiveRecord::Base - validates_exclusion_of :subdomain, :in => %w(www), + validates_exclusion_of :subdomain, :in => %w(www us ca jp), :message => "Subdomain %{value} is reserved." end -- cgit v1.2.3 From 0744d36f479ad35a89a50efaadb66674cac0a323 Mon Sep 17 00:00:00 2001 From: Krekoten' Marjan Date: Tue, 12 Oct 2010 22:55:19 +0300 Subject: Fix small typo in documentation --- actionpack/lib/action_controller/metal/conditional_get.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actionpack/lib/action_controller/metal/conditional_get.rb b/actionpack/lib/action_controller/metal/conditional_get.rb index 8930c13a68..a5e37172c9 100644 --- a/actionpack/lib/action_controller/metal/conditional_get.rb +++ b/actionpack/lib/action_controller/metal/conditional_get.rb @@ -66,7 +66,7 @@ module ActionController # Examples: # expires_in 20.minutes # expires_in 3.hours, :public => true - # expires in 3.hours, 'max-stale' => 5.hours, :public => true + # expires_in 3.hours, 'max-stale' => 5.hours, :public => true # # This method will overwrite an existing Cache-Control header. # See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html for more possibilities. -- cgit v1.2.3 From aec5ef243a0c85a9e3bafa89ce873d3837a6ce59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Wed, 13 Oct 2010 15:59:57 -0300 Subject: Remove doc for debugging callbacks. Methods don't exist in Rails master --- activerecord/lib/active_record/callbacks.rb | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/activerecord/lib/active_record/callbacks.rb b/activerecord/lib/active_record/callbacks.rb index 49671a1042..47428cfd0f 100644 --- a/activerecord/lib/active_record/callbacks.rb +++ b/activerecord/lib/active_record/callbacks.rb @@ -218,16 +218,6 @@ module ActiveRecord # needs to be aware of it because an ordinary +save+ will raise such exception # instead of quietly returning +false+. # - # == Debugging callbacks - # - # To list the methods and procs registered with a particular callback, append _callback_chain to - # the callback name that you wish to list and send that to your class from the Rails console: - # - # >> Topic.after_save_callback_chain - # => [#, kind:after_save, identifiernil, - # options{}] - # module Callbacks extend ActiveSupport::Concern -- cgit v1.2.3 From a37e1a6a692cd2cc82b9b885f2a289d28bc35a33 Mon Sep 17 00:00:00 2001 From: Ugis Ozols Date: Wed, 13 Oct 2010 23:31:37 +0300 Subject: Removed miscelenous letters. --- railties/guides/source/command_line.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/railties/guides/source/command_line.textile b/railties/guides/source/command_line.textile index cbdfda9215..752b5926f7 100644 --- a/railties/guides/source/command_line.textile +++ b/railties/guides/source/command_line.textile @@ -145,7 +145,7 @@ $ rails generate controller Greetings hello What all did this generate? It made sure a bunch of directories were in our application, and created a controller file, a functional test file, a helper for the view, and a view file. -Check out the controller and modify it a little (in +app/controllers/greetings_controller.rb+):ma +Check out the controller and modify it a little (in +app/controllers/greetings_controller.rb+): class GreetingsController < ApplicationController -- cgit v1.2.3 From cfb1ba023b11f82d776f9744ddbe7c826c8d7fbc Mon Sep 17 00:00:00 2001 From: Ryan Bigg and Xavier Noria Date: Thu, 14 Oct 2010 08:12:25 +1100 Subject: Use rather than underscores to fix display issue with 4.1.1.1 in the asssociation basics guide --- railties/guides/source/association_basics.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/railties/guides/source/association_basics.textile b/railties/guides/source/association_basics.textile index 6996dab8c5..f6d61373e1 100644 --- a/railties/guides/source/association_basics.textile +++ b/railties/guides/source/association_basics.textile @@ -550,7 +550,7 @@ build_customer create_customer -h6(#belongs_to-association). _association_(force_reload = false) +h6(#belongs_to-association). association(force_reload = false) The association method returns the associated object, if any. If no associated object is found, it returns +nil+. -- cgit v1.2.3 From a18cefbc3a9a025a076a0f5e18f6b9991e7df8e3 Mon Sep 17 00:00:00 2001 From: Nick Quaranto Date: Thu, 14 Oct 2010 17:24:59 -0400 Subject: Fixing a small typo in the generators guide --- railties/guides/source/generators.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/railties/guides/source/generators.textile b/railties/guides/source/generators.textile index b1f8ea29da..0f2cbb76dc 100644 --- a/railties/guides/source/generators.textile +++ b/railties/guides/source/generators.textile @@ -144,7 +144,7 @@ generators/initializer_generator.rb If none is found you get an error message. -INFO: The examples above put files under the application's +lib+ because said directoty belongs to +$LOAD_PATH+. +INFO: The examples above put files under the application's +lib+ because said directory belongs to +$LOAD_PATH+. h3. Customizing Your Workflow -- cgit v1.2.3 From 8be96a3bcf1a21bac38437512cac10ac9c1f952f Mon Sep 17 00:00:00 2001 From: Neil Middleton Date: Thu, 14 Oct 2010 23:11:34 +0100 Subject: Fixed casing of JavaScript (and RJS) [#183 state:resolved] --- railties/guides/source/layouts_and_rendering.textile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/railties/guides/source/layouts_and_rendering.textile b/railties/guides/source/layouts_and_rendering.textile index 50c5986a64..088e1f817c 100644 --- a/railties/guides/source/layouts_and_rendering.textile +++ b/railties/guides/source/layouts_and_rendering.textile @@ -90,7 +90,7 @@ If we want to display the properties of all the books in our view, we can do so <%= link_to 'New book', new_book_path %> -NOTE: The actual rendering is done by subclasses of +ActionView::TemplateHandlers+. This guide does not dig into that process, but it's important to know that the file extension on your view controls the choice of template handler. In Rails 2, the standard extensions are +.erb+ for ERB (HTML with embedded Ruby), +.rjs+ for RJS (javascript with embedded ruby) and +.builder+ for Builder (XML generator). +NOTE: The actual rendering is done by subclasses of +ActionView::TemplateHandlers+. This guide does not dig into that process, but it's important to know that the file extension on your view controls the choice of template handler. In Rails 2, the standard extensions are +.erb+ for ERB (HTML with embedded Ruby), +.rjs+ for RJS (JavaScript with embedded ruby) and +.builder+ for Builder (XML generator). h4. Using +render+ @@ -252,7 +252,7 @@ render :inline => h5. Using +render+ with +:update+ -You can also render javascript-based page updates inline using the +:update+ option to +render+: +You can also render JavaScript-based page updates inline using the +:update+ option to +render+: render :update do |page| @@ -260,7 +260,7 @@ render :update do |page| end -WARNING: Placing javascript updates in your controller may seem to streamline small updates, but it defeats the MVC orientation of Rails and will make it harder for other developers to follow the logic of your project. We recommend using a separate rjs template instead, no matter how small the update. +WARNING: Placing JavaScript updates in your controller may seem to streamline small updates, but it defeats the MVC orientation of Rails and will make it harder for other developers to follow the logic of your project. We recommend using a separate RJS template instead, no matter how small the update. h5. Rendering Text @@ -276,7 +276,7 @@ NOTE: By default, if you use the +:text+ option, the text is rendered without us h5. Rendering JSON -JSON is a javascript data format used by many AJAX libraries. Rails has built-in support for converting objects to JSON and rendering that JSON back to the browser: +JSON is a JavaScript data format used by many AJAX libraries. Rails has built-in support for converting objects to JSON and rendering that JSON back to the browser: render :json => @product @@ -655,7 +655,7 @@ I'll discuss each of these in turn. h4. Asset Tags -Asset tags provide methods for generating HTML that links views to assets like images, videos, audio, javascript, stylesheets, and feeds. There are six types of include tag: +Asset tags provide methods for generating HTML that links views to assets like images, videos, audio, JavaScript, stylesheets, and feeds. There are six types of include tag: * +auto_discovery_link_tag+ * +javascript_include_tag+ @@ -715,7 +715,7 @@ The +defaults+ option loads the Prototype and Scriptaculous libraries: <%= javascript_include_tag :defaults %> -The +all+ option loads every javascript file in +public/javascripts+, starting with the Prototype and Scriptaculous libraries: +The +all+ option loads every JavaScript file in +public/javascripts+, starting with the Prototype and Scriptaculous libraries: <%= javascript_include_tag :all %> @@ -727,7 +727,7 @@ You can supply the +:recursive+ option to load files in subfolders of +public/ja <%= javascript_include_tag :all, :recursive => true %> -If you're loading multiple javascript files, you can create a better user experience by combining multiple files into a single download. To make this happen in production, specify +:cache => true+ in your +javascript_include_tag+: +If you're loading multiple JavaScript files, you can create a better user experience by combining multiple files into a single download. To make this happen in production, specify +:cache => true+ in your +javascript_include_tag+: <%= javascript_include_tag "main", "columns", :cache => true %> @@ -962,7 +962,7 @@ The result of rendering this page into the supplied layout would be this HTML: -The +content_for+ method is very helpful when your layout contains distinct regions such as sidebars and footers that should get their own blocks of content inserted. It's also useful for inserting tags that load page-specific javascript or css files into the header of an otherwise generic layout. +The +content_for+ method is very helpful when your layout contains distinct regions such as sidebars and footers that should get their own blocks of content inserted. It's also useful for inserting tags that load page-specific JavaScript or css files into the header of an otherwise generic layout. h4. Using Partials -- cgit v1.2.3 From ebe61bf37c174a98019225d4aa227c6d45e69a59 Mon Sep 17 00:00:00 2001 From: Rob Zolkos Date: Fri, 15 Oct 2010 21:40:32 +1100 Subject: WEBrick is the default web server, not Mongrel [#186 state:resolved] --- railties/guides/source/getting_started.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile index 42b3313752..3f433c9704 100644 --- a/railties/guides/source/getting_started.textile +++ b/railties/guides/source/getting_started.textile @@ -282,7 +282,7 @@ You actually have a functional Rails application already. To see it, you need to $ rails server -This will fire up an instance of the Mongrel web server by default (Rails can also use several other web servers). To see your application in action, open a browser window and navigate to "http://localhost:3000":http://localhost:3000. You should see Rails' default information page: +This will fire up an instance of the WEBrick web server by default (Rails can also use several other web servers). To see your application in action, open a browser window and navigate to "http://localhost:3000":http://localhost:3000. You should see Rails' default information page: !images/rails_welcome.png(Welcome Aboard screenshot)! -- cgit v1.2.3 From cffae06a4f1b7aac86a7e99cfb244890f837f976 Mon Sep 17 00:00:00 2001 From: Rob Zolkos Date: Fri, 15 Oct 2010 23:38:31 +1100 Subject: remove Mongrel from debugger docs --- railties/guides/source/debugging_rails_applications.textile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/railties/guides/source/debugging_rails_applications.textile b/railties/guides/source/debugging_rails_applications.textile index 35069f33ad..b9d45fb13a 100644 --- a/railties/guides/source/debugging_rails_applications.textile +++ b/railties/guides/source/debugging_rails_applications.textile @@ -250,7 +250,7 @@ Make sure you have started your web server with the option +--debugger+: ~/PathTo/rails_project$ rails server --debugger -=> Booting Mongrel (use 'rails server webrick' to force WEBrick) +=> Booting WEBrick => Rails 3.0.0 application starting on http://0.0.0.0:3000 => Debugger enabled ... @@ -258,8 +258,6 @@ Make sure you have started your web server with the option +--debugger+: TIP: In development mode, you can dynamically +require \'ruby-debug\'+ instead of restarting the server, if it was started without +--debugger+. -In order to use Rails debugging you'll need to be running either *WEBrick* or *Mongrel*. For the moment, no alternative servers are supported. - h4. The Shell As soon as your application calls the +debugger+ method, the debugger will be started in a debugger shell inside the terminal window where you launched your application server, and you will be placed at ruby-debug's prompt +(rdb:n)+. The _n_ is the thread number. The prompt will also show you the next line of code that is waiting to run. -- cgit v1.2.3 From 410ef3818ff96d2fa69e305b0b741f1ddd192e61 Mon Sep 17 00:00:00 2001 From: Rajinder Yadav Date: Fri, 15 Oct 2010 22:23:11 -0400 Subject: added ignore rule for linux temp file ending with a tilda ~ --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2dfdf96e7f..4460c3d393 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +*~ *.gem pkg .bundle -- cgit v1.2.3 From 964033f35124bf9fc9bba0b4cd5c5cd176882902 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sat, 16 Oct 2010 18:44:24 +0200 Subject: Revert "added ignore rule for linux temp file ending with a tilda ~" This reverts commit 410ef3818ff96d2fa69e305b0b741f1ddd192e61. Reason: docrails has a very strict docs-only policy. --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4460c3d393..2dfdf96e7f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -*~ *.gem pkg .bundle -- cgit v1.2.3 From a38e653a6d512de3d22137cebc239d51f2513502 Mon Sep 17 00:00:00 2001 From: Neeraj Singh Date: Tue, 27 Apr 2010 21:55:24 -0400 Subject: json_escape makes json invalid doc change [#1485 state:resolved] --- activesupport/lib/active_support/core_ext/string/output_safety.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/activesupport/lib/active_support/core_ext/string/output_safety.rb b/activesupport/lib/active_support/core_ext/string/output_safety.rb index b53929c2a3..e6f13ec12a 100644 --- a/activesupport/lib/active_support/core_ext/string/output_safety.rb +++ b/activesupport/lib/active_support/core_ext/string/output_safety.rb @@ -35,10 +35,16 @@ class ERB # A utility method for escaping HTML entities in JSON strings. # This method is also aliased as j. # + # Note that after this operation is performed the output is not + # a valid JSON. + # # In your ERb templates, use this method to escape any HTML entities: # <%=j @person.to_json %> # # ==== Example: + # puts json_escape("{\"name\":\"john\",\"created_at\":\"2010-04-28T01:39:31Z\",\"id\":1}") + # # => {name:john,created_at:2010-04-28T01:39:31Z,id:1} + # # puts json_escape("is a > 0 & a < 10?") # # => is a \u003E 0 \u0026 a \u003C 10? def json_escape(s) -- cgit v1.2.3