From 769575300acb778ce812208073952109bc45a9fd Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Wed, 24 Nov 2010 09:19:27 +1100 Subject: Fix formatting issue with rake routes output for the namespace method --- actionpack/lib/action_dispatch/routing/mapper.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 879ccc5791..432a574419 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -588,13 +588,13 @@ module ActionDispatch # # This generates the following routes: # - # admin_posts GET /admin/posts(.:format) {:action=>"index", :controller=>"admin/posts"} - # admin_posts POST /admin/posts(.:format) {:action=>"create", :controller=>"admin/posts"} - # new_admin_post GET /admin/posts/new(.:format) {:action=>"new", :controller=>"admin/posts"} - # edit_admin_post GET /admin/posts/:id/edit(.:format) {:action=>"edit", :controller=>"admin/posts"} - # admin_post GET /admin/posts/:id(.:format) {:action=>"show", :controller=>"admin/posts"} - # admin_post PUT /admin/posts/:id(.:format) {:action=>"update", :controller=>"admin/posts"} - # admin_post DELETE /admin/posts/:id(.:format) {:action=>"destroy", :controller=>"admin/posts"} + # admin_posts GET /admin/posts(.:format) {:action=>"index", :controller=>"admin/posts"} + # admin_posts POST /admin/posts(.:format) {:action=>"create", :controller=>"admin/posts"} + # new_admin_post GET /admin/posts/new(.:format) {:action=>"new", :controller=>"admin/posts"} + # edit_admin_post GET /admin/posts/:id/edit(.:format) {:action=>"edit", :controller=>"admin/posts"} + # admin_post GET /admin/posts/:id(.:format) {:action=>"show", :controller=>"admin/posts"} + # admin_post PUT /admin/posts/:id(.:format) {:action=>"update", :controller=>"admin/posts"} + # admin_post DELETE /admin/posts/:id(.:format) {:action=>"destroy", :controller=>"admin/posts"} # === Supported options # # The +:path+, +:as+, +:module+, +:shallow_path+ and +:shallow_prefix+ all default to the name of the namespace. -- cgit v1.2.3 From 04af510b5678ea7bd4cd170257e7e3ef4423f834 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Wed, 24 Nov 2010 09:21:25 +1100 Subject: Paths in ActionDispatch::Scoping documentation should be for /admin/posts, not /admin/photos --- actionpack/lib/action_dispatch/routing/mapper.rb | 28 ++++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 432a574419..37d14944d6 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -439,13 +439,13 @@ module ActionDispatch # This will create a number of routes for each of the posts and comments # controller. For Admin::PostsController, Rails will create: # - # GET /admin/photos - # GET /admin/photos/new - # POST /admin/photos - # GET /admin/photos/1 - # GET /admin/photos/1/edit - # PUT /admin/photos/1 - # DELETE /admin/photos/1 + # GET /admin/posts + # GET /admin/posts/new + # POST /admin/posts + # GET /admin/posts/1 + # GET /admin/posts/1/edit + # PUT /admin/posts/1 + # DELETE /admin/posts/1 # # If you want to route /posts (without the prefix /admin) to # Admin::PostsController, you could use @@ -473,13 +473,13 @@ module ActionDispatch # not use scope. In the last case, the following paths map to # PostsController: # - # GET /admin/photos - # GET /admin/photos/new - # POST /admin/photos - # GET /admin/photos/1 - # GET /admin/photos/1/edit - # PUT /admin/photos/1 - # DELETE /admin/photos/1 + # GET /admin/posts + # GET /admin/posts/new + # POST /admin/posts + # GET /admin/posts/1 + # GET /admin/posts/1/edit + # PUT /admin/posts/1 + # DELETE /admin/posts/1 module Scoping def initialize(*args) #:nodoc: @scope = {} -- cgit v1.2.3 From 2974f57aaedd22f44b387ec72ca9f42a2982bb02 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Wed, 24 Nov 2010 09:25:01 +1100 Subject: Remove non-sensical first couple of lines for scope method documentation --- actionpack/lib/action_dispatch/routing/mapper.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 37d14944d6..8b1578769d 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -486,8 +486,6 @@ module ActionDispatch super end - # Used to route /photos (without the prefix /admin) - # to Admin::PostsController: # === Supported options # [:module] # If you want to route /posts (without the prefix /admin) to -- cgit v1.2.3 From 01af50d8b6be7b167c30f29c7407ce88bdfc9b2a Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Wed, 24 Nov 2010 09:27:12 +1100 Subject: Add :module option documentation for the resources method --- actionpack/lib/action_dispatch/routing/mapper.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 8b1578769d..1f3a831b7f 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -967,6 +967,7 @@ module ActionDispatch # GET /photos/:id/edit # PUT /photos/:id # DELETE /photos/:id + # # === Supported options # [:path_names] # Allows you to change the paths of the seven default actions. @@ -975,6 +976,13 @@ module ActionDispatch # resources :posts, :path_names => { :new => "brand_new" } # # The above example will now change /posts/new to /posts/brand_new + # + # [:module] + # Set the module where the controller can be found. Defaults to nothing. + # + # resources :posts, :module => "admin" + # + # All requests to the posts resources will now go to +Admin::PostsController+. def resources(*resources, &block) options = resources.extract_options! -- cgit v1.2.3 From fd47a4bf438e37a20756e0341cd7cd4e472fd3cb Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Wed, 24 Nov 2010 09:28:21 +1100 Subject: Document the :path option for resources :posts --- actionpack/lib/action_dispatch/routing/mapper.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 1f3a831b7f..f4d31eeff1 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -983,6 +983,14 @@ module ActionDispatch # resources :posts, :module => "admin" # # All requests to the posts resources will now go to +Admin::PostsController+. + # + # [:path] + # + # Set a path prefix for this resource. + # + # resources :posts, :path => "admin" + # + # All actions for this resource will now be at +/admin/posts+. def resources(*resources, &block) options = resources.extract_options! -- cgit v1.2.3 From e4a9af186a7316e2de018ff9306442b9fe0f2400 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Wed, 24 Nov 2010 09:31:29 +1100 Subject: Add mention of nested resource to resources documentation --- actionpack/lib/action_dispatch/routing/mapper.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index f4d31eeff1..fb1f0d3f0c 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -968,6 +968,21 @@ module ActionDispatch # PUT /photos/:id # DELETE /photos/:id # + # Resources can also be nested infinitely by using this block syntax: + # + # resources :photos do + # resources :comments + # end + # + # This generates the following comments routes: + # + # GET /photos/:id/comments/new + # POST /photos/:id/comments + # GET /photos/:id/comments/:id + # GET /photos/:id/comments/:id/edit + # PUT /photos/:id/comments/:id + # DELETE /photos/:id/comments/:id + # # === Supported options # [:path_names] # Allows you to change the paths of the seven default actions. -- cgit v1.2.3 From ad8e1ba45271ad910ba943840f6f58e973e9a046 Mon Sep 17 00:00:00 2001 From: Cheah Chu Yeow Date: Thu, 25 Nov 2010 16:11:26 +0800 Subject: Fix missing word in ActionMailer::Base documentation. --- actionmailer/lib/action_mailer/base.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 0bf60a2c24..1c2949f375 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -234,8 +234,8 @@ module ActionMailer #:nodoc: # default :sender => 'system@example.com' # end # - # You can pass in any header value that a Mail::Message, out of the box, ActionMailer::Base - # sets the following: + # You can pass in any header value that a Mail::Message accepts. Out of the box, + # ActionMailer::Base sets the following: # # * :mime_version => "1.0" # * :charset => "UTF-8", -- cgit v1.2.3 From aab76ce199e14ad86ead6a45c60de297f60b1df6 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Fri, 26 Nov 2010 13:51:35 +1100 Subject: There is no more routes_configuration_file method. --- railties/guides/source/configuring.textile | 2 -- 1 file changed, 2 deletions(-) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index e39ccbc4b8..5ee8d0d0a3 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -39,8 +39,6 @@ Rails will use that particular setting to configure Active Record. h4. Rails General Configuration -* +config.routes_configuration_file+ overrides the default path for the routes configuration file. This defaults to +config/routes.rb+. - * +config.cache_classes+ controls whether or not application classes should be reloaded on each request. * +config.cache_store+ configures which cache store to use for Rails caching. Options include +:memory_store+, +:file_store+, +:mem_cache_store+ or the name of your own custom class. -- cgit v1.2.3 From 26837734d6f50684056e059dfe853653a8ec50d0 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Fri, 26 Nov 2010 13:54:37 +1100 Subject: Don't mention Rails 2.3, given that this is supposed to be a guide for Rails *3*. --- railties/guides/source/configuring.textile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index 5ee8d0d0a3..952b20f586 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -23,10 +23,10 @@ To run some code before Rails itself is loaded, simply put it above the call to h3. Configuring Rails Components -In general, the work of configuring Rails means configuring the components of Rails, as well as configuring Rails itself. The +application.rb+ and environment-specific configuration files (such as +config/environments/production.rb+) allow you to specify the various settings that you want to pass down to all of the components. For example, the default Rails 2.3 +application.rb+ file includes one setting: +In general, the work of configuring Rails means configuring the components of Rails, as well as configuring Rails itself. The +application.rb+ and environment-specific configuration files (such as +config/environments/production.rb+) allow you to specify the various settings that you want to pass down to all of the components. For example, the default Rails 3.0 +application.rb+ file includes this setting: -config.filter_parameters << :password + config.filter_parameters += [:password] This is a setting for Rails itself. If you want to pass settings to individual Rails components, you can do so via the same +config+ object: -- cgit v1.2.3 From 8b114bec061d83352312d5710689ace4557443ab Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Fri, 26 Nov 2010 13:56:39 +1100 Subject: Mention what cache_classes defaults to in all three default environments --- railties/guides/source/configuring.textile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index 952b20f586..b3c9b4ad8d 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -32,14 +32,14 @@ In general, the work of configuring Rails means configuring the components of Ra This is a setting for Rails itself. If you want to pass settings to individual Rails components, you can do so via the same +config+ object: -config.active_record.timestamped_migrations = false + config.active_record.timestamped_migrations = false Rails will use that particular setting to configure Active Record. h4. Rails General Configuration -* +config.cache_classes+ controls whether or not application classes should be reloaded on each request. +* +config.cache_classes+ controls whether or not application classes should be reloaded on each request. Defaults to _true_ in development, _false_ in test and production. * +config.cache_store+ configures which cache store to use for Rails caching. Options include +:memory_store+, +:file_store+, +:mem_cache_store+ or the name of your own custom class. -- cgit v1.2.3 From eb21791c5bd1881163328d4b0aa815a6e01a4ded Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Fri, 26 Nov 2010 13:58:01 +1100 Subject: There is no controller_paths method in Rails 3 --- railties/guides/source/configuring.textile | 2 -- 1 file changed, 2 deletions(-) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index b3c9b4ad8d..2cc71f2a12 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -45,8 +45,6 @@ h4. Rails General Configuration * +config.colorize_logging+ (true by default) specifies whether or not to use ANSI color codes when logging information. -* +config.controller_paths+ accepts an array of paths that will be searched for controllers. Defaults to +app/controllers+. - * +config.database_configuration_file+ overrides the default path for the database configuration file. Default to +config/database.yml+. * +config.dependency_loading+ enables or disables dependency loading during the request cycle. Setting dependency_loading to _true_ will allow new classes to be loaded during a request and setting it to _false_ will disable this behavior. -- cgit v1.2.3 From db7c8abbb69f0ac06719b1e69f6276d633669a9e Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Fri, 26 Nov 2010 13:59:51 +1100 Subject: There is no database_configuration_file method in Rails 3 --- railties/guides/source/configuring.textile | 2 -- 1 file changed, 2 deletions(-) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index 2cc71f2a12..c6d4a8a799 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -45,8 +45,6 @@ h4. Rails General Configuration * +config.colorize_logging+ (true by default) specifies whether or not to use ANSI color codes when logging information. -* +config.database_configuration_file+ overrides the default path for the database configuration file. Default to +config/database.yml+. - * +config.dependency_loading+ enables or disables dependency loading during the request cycle. Setting dependency_loading to _true_ will allow new classes to be loaded during a request and setting it to _false_ will disable this behavior. * +config.eager_load_paths+ accepts an array of paths from which Rails will eager load on boot if cache classes is enabled. All elements of this array must also be in +load_paths+. -- cgit v1.2.3 From c8af6c28cc82d0c6cbddd326f316405c570eac2d Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Fri, 26 Nov 2010 14:01:09 +1100 Subject: load_once_paths is now autoload_paths in Rails 3 --- railties/guides/source/configuring.textile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index c6d4a8a799..fc4cc623a1 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -39,6 +39,10 @@ Rails will use that particular setting to configure Active Record. h4. Rails General Configuration +* +config.autoload_once_paths+ accepts an array of paths from which Rails will automatically load from only once. All elements of this array must also be in +autoload_paths+. + +* +config.autoload_paths+ accepts an array of additional paths to prepend to the load path. By default, all app, lib, vendor and mock paths are included in this list. + * +config.cache_classes+ controls whether or not application classes should be reloaded on each request. Defaults to _true_ in development, _false_ in test and production. * +config.cache_store+ configures which cache store to use for Rails caching. Options include +:memory_store+, +:file_store+, +:mem_cache_store+ or the name of your own custom class. @@ -49,9 +53,6 @@ h4. Rails General Configuration * +config.eager_load_paths+ accepts an array of paths from which Rails will eager load on boot if cache classes is enabled. All elements of this array must also be in +load_paths+. -* +config.load_once_paths+ accepts an array of paths from which Rails will automatically load from only once. All elements of this array must also be in +load_paths+. - -* +config.load_paths+ accepts an array of additional paths to prepend to the load path. By default, all app, lib, vendor and mock paths are included in this list. * +config.log_level+ defines the verbosity of the Rails logger. In production mode, this defaults to +:info+. In development mode, it defaults to +:debug+. -- cgit v1.2.3 From 9979251d7c2ab886410f5448dfec701218cc0d15 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Fri, 26 Nov 2010 14:05:00 +1100 Subject: There is no plugin_loader config option in Rails 3 --- railties/guides/source/configuring.textile | 3 --- 1 file changed, 3 deletions(-) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index fc4cc623a1..dd6aba12d6 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -53,15 +53,12 @@ h4. Rails General Configuration * +config.eager_load_paths+ accepts an array of paths from which Rails will eager load on boot if cache classes is enabled. All elements of this array must also be in +load_paths+. - * +config.log_level+ defines the verbosity of the Rails logger. In production mode, this defaults to +:info+. In development mode, it defaults to +:debug+. * +config.log_path+ overrides the path to the log file to use. Defaults to +log/#{environment}.log+ (e.g. log/development.log or log/production.log). * +config.logger+ accepts a logger conforming to the interface of Log4r or the default Ruby 1.8+ Logger class, which is then used to log information from Action Controller. Set to nil to disable logging. -* +config.plugin_loader+ overrides the class that handles loading each plugin. Defaults to +Rails::Plugin::Loader+. - * +config.plugin_locators+ overrides the class that handle finding the desired plugins that you‘d like to load for your application. By default it is the +Rails::Plugin::FileSystemLocator+. * +config.plugin_paths+ overrides the path to the root of the plugins directory. Defaults to +vendor/plugins+. -- cgit v1.2.3 From f01f7fc62953dd402ac118c07ae1851a181c4a67 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Fri, 26 Nov 2010 14:05:22 +1100 Subject: There is no plugin_locators config option in Rails 3 --- railties/guides/source/configuring.textile | 2 -- 1 file changed, 2 deletions(-) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index dd6aba12d6..6e5f917836 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -59,8 +59,6 @@ h4. Rails General Configuration * +config.logger+ accepts a logger conforming to the interface of Log4r or the default Ruby 1.8+ Logger class, which is then used to log information from Action Controller. Set to nil to disable logging. -* +config.plugin_locators+ overrides the class that handle finding the desired plugins that you‘d like to load for your application. By default it is the +Rails::Plugin::FileSystemLocator+. - * +config.plugin_paths+ overrides the path to the root of the plugins directory. Defaults to +vendor/plugins+. * +config.plugins+ accepts the list of plugins to load. If this is set to nil, all plugins will be loaded. If this is set to [], no plugins will be loaded. Otherwise, plugins will be loaded in the order specified. -- cgit v1.2.3 From ffca2d7f1469fd5444b1417e5d2d4bd3d7d0af18 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Fri, 26 Nov 2010 14:05:43 +1100 Subject: There is no plugin_paths config option in Rails 3 --- railties/guides/source/configuring.textile | 2 -- 1 file changed, 2 deletions(-) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index 6e5f917836..e0ef07fa36 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -59,8 +59,6 @@ h4. Rails General Configuration * +config.logger+ accepts a logger conforming to the interface of Log4r or the default Ruby 1.8+ Logger class, which is then used to log information from Action Controller. Set to nil to disable logging. -* +config.plugin_paths+ overrides the path to the root of the plugins directory. Defaults to +vendor/plugins+. - * +config.plugins+ accepts the list of plugins to load. If this is set to nil, all plugins will be loaded. If this is set to [], no plugins will be loaded. Otherwise, plugins will be loaded in the order specified. * +config.preload_frameworks+ enables or disables preloading all frameworks at startup. -- cgit v1.2.3 From 69ae74210c6b49219b97a8e2e2711a81a523d8b8 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Fri, 26 Nov 2010 14:07:42 +1100 Subject: There is no root_path config option in Rails 3 --- railties/guides/source/configuring.textile | 2 -- 1 file changed, 2 deletions(-) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index e0ef07fa36..eee46b47ea 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -65,8 +65,6 @@ h4. Rails General Configuration * +config.reload_plugins+ enables or disables plugin reloading. -* +config.root_path+ configures the root path of the application. - * +config.time_zone+ sets the default time zone for the application and enables time zone awareness for Active Record. * +config.view_path+ sets the path of the root of an application's views. Defaults to +app/views+. -- cgit v1.2.3 From 9a4d6724573470d74ef9ef4572dbe04a1b5d9b4a Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Fri, 26 Nov 2010 14:08:26 +1100 Subject: There is no view_path config option in Rails 3 --- railties/guides/source/configuring.textile | 2 -- 1 file changed, 2 deletions(-) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index eee46b47ea..e614d232fe 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -67,8 +67,6 @@ h4. Rails General Configuration * +config.time_zone+ sets the default time zone for the application and enables time zone awareness for Active Record. -* +config.view_path+ sets the path of the root of an application's views. Defaults to +app/views+. - * +config.whiny_nils+ enables or disabled warnings when an methods of nil are invoked. Defaults to _false_. h4. Configuring i18n -- cgit v1.2.3 From 33298d8e38eab9ef2e528478fbd2d4585f732d82 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Fri, 26 Nov 2010 14:16:57 +1100 Subject: There is no config.action_controller.params_parser method for Rails 3. This is now handled by the ActionDispatch::ParamsParser middleware. --- railties/guides/source/configuring.textile | 2 -- 1 file changed, 2 deletions(-) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index e614d232fe..03a360f87f 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -121,8 +121,6 @@ h4. Configuring Action Controller WARNING: Threadsafe operation is incompatible with the normal workings of development mode Rails. In particular, automatic dependency loading and class reloading are automatically disabled when you call +config.threadsafe!+. -* +config.action_controller.param_parsers+ provides an array of handlers that can extract information from incoming HTTP requests and add it to the +params+ hash. By default, parsers for multipart forms, URL-encoded forms, XML, and JSON are active. - * +config.action_controller.default_charset+ specifies the default character set for all renders. The default is "utf-8". * +config.action_controller.logger+ accepts a logger conforming to the interface of Log4r or the default Ruby 1.8+ Logger class, which is then used to log information from Action Controller. Set to nil to disable logging. -- cgit v1.2.3 From f1406a905adc77ea719a6f3f85229d43a4766dc5 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Fri, 26 Nov 2010 14:19:17 +1100 Subject: There is no config.action_controller.resource_path_names method for Rails 3 --- railties/guides/source/configuring.textile | 2 -- 1 file changed, 2 deletions(-) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index 03a360f87f..b4dc223c71 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -125,8 +125,6 @@ WARNING: Threadsafe operation is incompatible with the normal workings of develo * +config.action_controller.logger+ accepts a logger conforming to the interface of Log4r or the default Ruby 1.8+ Logger class, which is then used to log information from Action Controller. Set to nil to disable logging. -* +config.action_controller.resource_path_names+ is a hash of default names for several RESTful actions. By default, the new action is named +new+ and the edit action is named +edit+. - * +config.action_controller.request_forgery_protection_token+ sets the token parameter name for RequestForgery. Calling +protect_from_forgery+ sets it to +:authenticity_token+ by default. * +config.action_controller.optimise_named_routes+ turns on some optimizations in generating the routing table. It is set to +true+ by default. -- cgit v1.2.3 From 3eec4d4f93df70ea9c421df44c23ca0d4595534c Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Fri, 26 Nov 2010 14:20:33 +1100 Subject: There is no config.action_controller.optimize_named_routes method for Rails 3 --- railties/guides/source/configuring.textile | 2 -- 1 file changed, 2 deletions(-) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index b4dc223c71..d6df1e7cbe 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -127,8 +127,6 @@ WARNING: Threadsafe operation is incompatible with the normal workings of develo * +config.action_controller.request_forgery_protection_token+ sets the token parameter name for RequestForgery. Calling +protect_from_forgery+ sets it to +:authenticity_token+ by default. -* +config.action_controller.optimise_named_routes+ turns on some optimizations in generating the routing table. It is set to +true+ by default. - * +config.action_controller.allow_forgery_protection+ enables or disables CSRF protection. By default this is +false+ in test mode and +true+ in all other modes. * +config.action_controller.relative_url_root+ can be used to tell Rails that you are deploying to a subdirectory. The default is +ENV['RAILS_RELATIVE_URL_ROOT']+. -- cgit v1.2.3 From b4ec8ad09c028a5e322a04eacf487b775a672ec2 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Fri, 26 Nov 2010 14:21:04 +1100 Subject: Separate Action Dispatch and Action Pack sections in Configuration Guide. --- railties/guides/source/configuring.textile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index d6df1e7cbe..c948f680f8 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -131,8 +131,6 @@ WARNING: Threadsafe operation is incompatible with the normal workings of develo * +config.action_controller.relative_url_root+ can be used to tell Rails that you are deploying to a subdirectory. The default is +ENV['RAILS_RELATIVE_URL_ROOT']+. -* +config.action_dispatch.session_store+ sets the name of the store for session data. The default is +:cookie_store+; other valid options include +:active_record_store+, +:mem_cache_store+ or the name of your own custom class. - The caching code adds two additional settings: * +ActionController::Base.page_cache_directory+ sets the directory where Rails will create cached pages for your web server. The default is +Rails.public_path+ (which is usually set to +Rails.root + "/public"+). @@ -147,6 +145,10 @@ The Active Record session store can also be configured: * +ActiveRecord::SessionStore::Session.data_column_name+ sets the name of the column which stores marshaled session data. Defaults to +data+. +h4. Configuring Action Dispatch + +* +config.action_dispatch.session_store+ sets the name of the store for session data. The default is +:cookie_store+; other valid options include +:active_record_store+, +:mem_cache_store+ or the name of your own custom class. + h4. Configuring Action View There are only a few configuration options for Action View, starting with four on +ActionView::Base+: -- cgit v1.2.3 From 3d8d21b5132bb6852fe9533710d9105ab4d30ec8 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Fri, 26 Nov 2010 14:23:40 +1100 Subject: There is no config.action_view.warn_cache_misses method for Rails 3 --- railties/guides/source/configuring.textile | 2 -- 1 file changed, 2 deletions(-) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index c948f680f8..0803c1e7f4 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -155,8 +155,6 @@ There are only a few configuration options for Action View, starting with four o * +config.action_view.debug_rjs+ specifies whether RJS responses should be wrapped in a try/catch block that alert()s the caught exception (and then re-raises it). The default is +false+. -* +config.action_view.warn_cache_misses+ tells Rails to display a warning whenever an action results in a cache miss on your view paths. The default is +false+. - * +config.action_view.field_error_proc+ provides an HTML generator for displaying errors that come from Active Record. The default is Proc.new{ |html_tag, instance| %Q(%<div class="field_with_errors">#{html_tag}</div>).html_safe } * +config.action_view.default_form_builder+ tells Rails which form builder to use by default. The default is +ActionView::Helpers::FormBuilder+. -- cgit v1.2.3 From 8b49fae3eaa8d227261be06124ee7a8041ea77d7 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Fri, 26 Nov 2010 14:24:51 +1100 Subject: There is no config.action_mailer.template_root method for Rails 3 --- railties/guides/source/configuring.textile | 2 -- 1 file changed, 2 deletions(-) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index 0803c1e7f4..67028c683b 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -167,8 +167,6 @@ h4. Configuring Action Mailer There are a number of settings available on +config.action_mailer+: -* +config.action_mailer.template_root+ gives the root folder for Action Mailer templates. - * +config.action_mailer.logger+ accepts a logger conforming to the interface of Log4r or the default Ruby 1.8+ Logger class, which is then used to log information from Action Mailer. Set to nil to disable logging. * +config.action_mailer.smtp_settings+ allows detailed configuration for the +:smtp+ delivery method. It accepts a hash of options, which can include any of these options: -- cgit v1.2.3 From e968acc21c7e60e09a8ef076a00ef22bce2813b9 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Fri, 26 Nov 2010 14:25:46 +1100 Subject: Update ActionMailer documentation to not use deprecated template_root method as documentation, but rather raise_delivery_errors method --- actionmailer/lib/action_mailer/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 0bf60a2c24..d13ae3dd3a 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -273,7 +273,7 @@ module ActionMailer #:nodoc: # = Configuration options # # These options are specified on the class level, like - # ActionMailer::Base.template_root = "/my/templates" + # ActionMailer::Base.raise_delivery_errors = true # # * default - You can pass this in at a class level as well as within the class itself as # per the above section. -- cgit v1.2.3 From 926d64e8b3a0cfbc233a0c564b5dfb0aeacb9546 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Fri, 26 Nov 2010 14:32:20 +1100 Subject: There is no config.action_mailer.default_charset method for Rails 3 --- railties/guides/source/configuring.textile | 2 -- 1 file changed, 2 deletions(-) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index 67028c683b..b5f32671a8 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -187,8 +187,6 @@ There are a number of settings available on +config.action_mailer+: * +config.action_mailer.perform_deliveries+ specifies whether mail will actually be delivered. By default this is +true+; it can be convenient to set it to +false+ for testing. -* +config.action_mailer.default_charset+ tells Action Mailer which character set to use for the body and for encoding the subject. It defaults to +utf-8+. - * +config.action_mailer.default_content_type+ specifies the default content type used for the main part of the message. It defaults to "text/plain" * +config.action_mailer.default_mime_version+ is the default MIME version for the message. It defaults to +1.0+. -- cgit v1.2.3 From 66aefed136ef0c087e9448d8098cea629e211144 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Fri, 26 Nov 2010 14:32:36 +1100 Subject: There is no config.action_mailer.default_content_type method for Rails 3 --- railties/guides/source/configuring.textile | 2 -- 1 file changed, 2 deletions(-) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index b5f32671a8..df56768de9 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -187,8 +187,6 @@ There are a number of settings available on +config.action_mailer+: * +config.action_mailer.perform_deliveries+ specifies whether mail will actually be delivered. By default this is +true+; it can be convenient to set it to +false+ for testing. -* +config.action_mailer.default_content_type+ specifies the default content type used for the main part of the message. It defaults to "text/plain" - * +config.action_mailer.default_mime_version+ is the default MIME version for the message. It defaults to +1.0+. * +config.action_mailer.default_implicit_parts_order+ - When a message is built implicitly (i.e. multiple parts are assembled from templates -- cgit v1.2.3 From d0006121c581d0acadf7d46f955051be10128238 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Fri, 26 Nov 2010 14:43:16 +1100 Subject: Mention the default config.action_mailer.default options in Configuration guide --- railties/guides/source/configuring.textile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index df56768de9..bb8561587c 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -187,7 +187,13 @@ There are a number of settings available on +config.action_mailer+: * +config.action_mailer.perform_deliveries+ specifies whether mail will actually be delivered. By default this is +true+; it can be convenient to set it to +false+ for testing. -* +config.action_mailer.default_mime_version+ is the default MIME version for the message. It defaults to +1.0+. +* +config.action_mailer.default+ configures Action Mailer defaults. These default to: + + :mime_version => "1.0", + :charset => "UTF-8", + :content_type => "text/plain", + :parts_order => [ "text/plain", "text/enriched", "text/html" ] + * +config.action_mailer.default_implicit_parts_order+ - When a message is built implicitly (i.e. multiple parts are assembled from templates which specify the content type in their filenames) this variable controls how the parts are ordered. Defaults to +["text/html", "text/enriched", "text/plain"]+. Items that appear first in the array have higher priority in the mail client -- cgit v1.2.3 From e96a64fb3910ad0ec2f3b7a970ae6047dfb89e01 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Fri, 26 Nov 2010 14:53:12 +1100 Subject: There is no config.action_mailer.default_implicit_parts_order method for Rails 3 --- railties/guides/source/configuring.textile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index bb8561587c..a7244de19f 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -195,10 +195,6 @@ There are a number of settings available on +config.action_mailer+: :parts_order => [ "text/plain", "text/enriched", "text/html" ] -* +config.action_mailer.default_implicit_parts_order+ - When a message is built implicitly (i.e. multiple parts are assembled from templates -which specify the content type in their filenames) this variable controls how the parts are ordered. Defaults to +["text/html", "text/enriched", "text/plain"]+. Items that appear first in the array have higher priority in the mail client -and appear last in the mime encoded message. - h4. Configuring Active Resource There is a single configuration setting available on +config.active_resource+: -- cgit v1.2.3 From 1d5db09ca7cd2d8fa2d05c138e0211979fdbe966 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Fri, 26 Nov 2010 14:55:56 +1100 Subject: There is no RAILS_GEM_VERSION environment variable or constant for Rails 3, since this is now managed by Bundler --- railties/guides/source/configuring.textile | 2 -- 1 file changed, 2 deletions(-) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index a7244de19f..a4e85de590 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -247,8 +247,6 @@ Some parts of Rails can also be configured externally by supplying environment v * +ENV["RAILS_CACHE_ID"]+ and +ENV["RAILS_APP_VERSION"]+ are used to generate expanded cache keys in Rails' caching code. This allows you to have multiple separate caches from the same application. -* +ENV['RAILS_GEM_VERSION']+ defines the version of the Rails gems to use, if +RAILS_GEM_VERSION+ is not defined in your +environment.rb+ file. - h3. Changelog * August 13, 2009: Updated with config syntax and added general configuration options by "John Pignata" -- cgit v1.2.3 From 788fdb2ac1ae930660a135000abf92c36735815f Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Fri, 26 Nov 2010 14:57:16 +1100 Subject: Update Changelog for configuring guide --- railties/guides/source/configuring.textile | 1 + 1 file changed, 1 insertion(+) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index a4e85de590..efb5663e33 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -249,6 +249,7 @@ Some parts of Rails can also be configured externally by supplying environment v h3. Changelog +* November 26, 2010: Removed all config settings not available in Rails 3 (Ryan Bigg) * August 13, 2009: Updated with config syntax and added general configuration options by "John Pignata" * January 3, 2009: First reasonably complete draft by "Mike Gunderloy":credits.html#mgunderloy * November 5, 2008: Rough outline by "Mike Gunderloy":credits.html#mgunderloy -- cgit v1.2.3 From ff04f6fee4a71da867398f49cc2d9e22760dd7e0 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Fri, 26 Nov 2010 15:09:17 +1100 Subject: root_path is now simply root in Rails 3 --- railties/guides/source/configuring.textile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index efb5663e33..30f8e31095 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -65,6 +65,8 @@ h4. Rails General Configuration * +config.reload_plugins+ enables or disables plugin reloading. +* +config.root+ configures the root path of the application. + * +config.time_zone+ sets the default time zone for the application and enables time zone awareness for Active Record. * +config.whiny_nils+ enables or disabled warnings when an methods of nil are invoked. Defaults to _false_. -- cgit v1.2.3 From 6bb462861f7cca070f1d3933c19c10b18fa44c9e Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Fri, 26 Nov 2010 16:46:06 +1100 Subject: There is no more load_application_initializers in Rails 3 --- railties/guides/source/configuring.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index 30f8e31095..3986faa3cd 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -13,7 +13,7 @@ Rails offers (at least) four good spots to place initialization code: * application.rb * Environment-specific Configuration Files -* Initializers (load_application_initializers) +* Initializers * After-Initializers h3. Running Code Before Rails -- cgit v1.2.3 From 72e973ebbcddbeb172c2dd3a7ddc12957dc5bec0 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Fri, 26 Nov 2010 17:03:14 +1100 Subject: Add mention of after_initialize to the config guide --- railties/guides/source/configuring.textile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index 3986faa3cd..154eebc0c1 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -39,6 +39,14 @@ Rails will use that particular setting to configure Active Record. h4. Rails General Configuration +* +config.after_initialize+ takes a block which will be ran _after_ Rails has finished initializing. Useful for configuring values set up by other initializers: + + + config.after_initialize do + ActionView::Base.sanitized_allowed_tags.delete 'div' + end + + * +config.autoload_once_paths+ accepts an array of paths from which Rails will automatically load from only once. All elements of this array must also be in +autoload_paths+. * +config.autoload_paths+ accepts an array of additional paths to prepend to the load path. By default, all app, lib, vendor and mock paths are included in this list. -- cgit v1.2.3 From 8d6ac59d58ff7fce851a894d714e0677c11d7eb6 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Fri, 26 Nov 2010 18:06:14 +1100 Subject: Added documentation for config.generators to the config guide --- railties/guides/source/configuring.textile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index 154eebc0c1..c395e42c00 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -47,6 +47,8 @@ h4. Rails General Configuration end +* +config.app_generators+ alternate name for +config.generators+. See the "Configuring Generators" section below for how to use this. + * +config.autoload_once_paths+ accepts an array of paths from which Rails will automatically load from only once. All elements of this array must also be in +autoload_paths+. * +config.autoload_paths+ accepts an array of additional paths to prepend to the load path. By default, all app, lib, vendor and mock paths are included in this list. @@ -79,6 +81,31 @@ h4. Rails General Configuration * +config.whiny_nils+ enables or disabled warnings when an methods of nil are invoked. Defaults to _false_. +h4. Configuring Generators + +Rails 3 allows you to alter what generators are used with the +config.generators+ method. This method takes a block: + + + config.generators do |g| + g.orm :active_record + g.test_framework :test_unit + end + + +The full set of methods that can be used in this block are as follows: + +* +force_plural+ allows pluralized model names. Defaults to _false_. +* +helper+ defines whether or not to generate helpers. Defaults to _true_ +* +orm+ defines which orm to use. Defaults to _nil_, so will use Active Record by default. +* +integration_tool+ defines which integration tool to use. Defaults to _nil_ +* +performance_tool+ defines which performance tool to use. Defaults to _nil_ +* +resource_controller+ defines which generator to use for generating a controller when using +rails generate resource+. Defaults to +:controller+. +* +scaffold_controller+ different from +resource_controller+, defines which generator to use for generating a _scaffolded_ controller when using +rails generate scaffold+. Defaults to +:scaffold_controller+ +* +stylesheets+ turns on the hook for stylesheets in generators. Used in Rails for when the +scaffold+ generator is ran, but this hook can be used in other generates as well. +* +test_framework+ defines which test framework to use. Defaults to _nil_, so will use Test::Unit by default. +* +template_engine+ defines which template engine to use, such as ERB or Haml. Defaults to +:erb+. + + h4. Configuring i18n * +config.i18n.default_locale+ sets the default locale of an application used for i18n. Defaults to +:en+. -- cgit v1.2.3 From 5b9f6a74db1a58c5557087cd924fd67dd9cf43e0 Mon Sep 17 00:00:00 2001 From: Aditya Sanghi Date: Fri, 26 Nov 2010 16:41:33 +0530 Subject: Resolving LH #5986, cookies doc updates --- actionpack/lib/action_dispatch/middleware/cookies.rb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/actionpack/lib/action_dispatch/middleware/cookies.rb b/actionpack/lib/action_dispatch/middleware/cookies.rb index c4c2e1acd7..b0a4e3d949 100644 --- a/actionpack/lib/action_dispatch/middleware/cookies.rb +++ b/actionpack/lib/action_dispatch/middleware/cookies.rb @@ -16,17 +16,23 @@ module ActionDispatch # Examples for writing: # # # Sets a simple session cookie. + # # This cookie will be deleted when the user's browser is closed. # cookies[:user_name] = "david" # + # # Assign an array of values to a cookie. + # cookies[:lat_lon] = [47.68, -122.37] + # # # Sets a cookie that expires in 1 hour. # cookies[:login] = { :value => "XJ-122", :expires => 1.hour.from_now } # # # Sets a signed cookie, which prevents a user from tampering with its value. - # # You must specify a value in ActionController::Base.cookie_verifier_secret. - # cookies.signed[:remember_me] = [current_user.id, current_user.salt] + # # The cookie is signed by your app's config.secret_token value. + # # Rails generates this value by default when you create a new Rails app. + # cookies.signed[:user_id] = current_user.id # # # Sets a "permanent" cookie (which expires in 20 years from now). # cookies.permanent[:login] = "XJ-122" + # # # You can also chain these methods: # cookies.permanent.signed[:login] = "XJ-122" # @@ -34,6 +40,7 @@ module ActionDispatch # # cookies[:user_name] # => "david" # cookies.size # => 2 + # cookies[:lat_lon] # => [47.68, -122.37] # # Example for deleting: # @@ -275,7 +282,7 @@ module ActionDispatch "integrity hash for cookie session data. Use " + "config.secret_token = \"some secret phrase of at " + "least #{SECRET_MIN_LENGTH} characters\"" + - "in config/application.rb" + "in config/initializers/secret_token.rb" end if secret.length < SECRET_MIN_LENGTH -- cgit v1.2.3 From fe2103a1c8336e8ef164d696e8eaeab62158d84b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Mej=C3=ADa?= Date: Fri, 26 Nov 2010 14:11:28 +0100 Subject: Added missing word. --- railties/guides/source/contributing_to_rails.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/railties/guides/source/contributing_to_rails.textile b/railties/guides/source/contributing_to_rails.textile index f501335958..721adc00d7 100644 --- a/railties/guides/source/contributing_to_rails.textile +++ b/railties/guides/source/contributing_to_rails.textile @@ -127,7 +127,7 @@ You can now run tests as you did for +sqlite3+: rake test_mysql -You can also +myqsl+ with +postgresql+, +jdbcmysql+, +jdbcsqlite3+ or +jdbcpostgresql+. Check out the file +activerecord/RUNNING_UNIT_TESTS+ for information on running more targeted database tests, or the file +ci/ci_build.rb+ to see the test suite that the Rails continuous integration server runs. +You can also replace +myqsl+ with +postgresql+, +jdbcmysql+, +jdbcsqlite3+ or +jdbcpostgresql+. Check out the file +activerecord/RUNNING_UNIT_TESTS+ for information on running more targeted database tests, or the file +ci/ci_build.rb+ to see the test suite that the Rails continuous integration server runs. NOTE: If you're working with Active Record code, you _must_ ensure that the tests pass for at least MySQL, PostgreSQL, and SQLite 3. Subtle differences between the various Active Record database adapters have been behind the rejection of many patches that looked OK when tested only against MySQL. -- cgit v1.2.3 From 3a50799ab8aede48767612ba1d4cc904f294cdb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Mej=C3=ADa?= Date: Fri, 26 Nov 2010 17:16:52 +0100 Subject: Mentioning catch with Bundler remembering options between different calls --- railties/guides/source/contributing_to_rails.textile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/railties/guides/source/contributing_to_rails.textile b/railties/guides/source/contributing_to_rails.textile index 721adc00d7..ccb9db5eee 100644 --- a/railties/guides/source/contributing_to_rails.textile +++ b/railties/guides/source/contributing_to_rails.textile @@ -105,12 +105,17 @@ mysql> GRANT ALL PRIVILEGES ON activerecord_unittest2.* to 'rails'@'localhost'; -Then ensure you run bundle install without the +--without db+ option: +Now you'll have to install Active Record dependencies. This step is a little tricky because just running +bundle install+ without the +--without db+ parameter won't get those dependencies installed. It turns out that bundler remembers the +--without db+ parameter between calls so you'll have to manually override this. (See the "+bundle_install+ man page":http://gembundler.com/man/bundle-install.1.html for details) + +The easiest way to do this is to remove bundler's config file and then run +install+ again: +rm .bundle/config bundle install +INFO: If you don't feel comfortable deleting bundler's config file, you can achieve the same effect by manually removing the "+BUNDLE_WITHOUT: db+" line on +.bundle/config+. + Finally, enter this from the +activerecord+ directory to create the test databases: -- cgit v1.2.3 From 6aa408e11cc99603778eb99e8cd2e585e0f97b50 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Fri, 26 Nov 2010 21:14:58 +1100 Subject: Add mention of config.serve_static_assets to config guide --- railties/guides/source/configuring.textile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index c395e42c00..91c4c2b0f7 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -77,6 +77,8 @@ h4. Rails General Configuration * +config.root+ configures the root path of the application. +* +config.serve_static_assets+ configures Rails to serve static assets. Defaults to _true_, but in the production environment is turned off. The server software used to run the application should be used to serve the assets instead. + * +config.time_zone+ sets the default time zone for the application and enables time zone awareness for Active Record. * +config.whiny_nils+ enables or disabled warnings when an methods of nil are invoked. Defaults to _false_. -- cgit v1.2.3 From 167964149e76d66742675a1505e1030e1c8f440b Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Sat, 27 Nov 2010 07:56:08 +1100 Subject: Add explicit statement that verify_authenticity_token can be turned off for actions. --- .../lib/action_controller/metal/request_forgery_protection.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/actionpack/lib/action_controller/metal/request_forgery_protection.rb b/actionpack/lib/action_controller/metal/request_forgery_protection.rb index 02f577647e..148efbb081 100644 --- a/actionpack/lib/action_controller/metal/request_forgery_protection.rb +++ b/actionpack/lib/action_controller/metal/request_forgery_protection.rb @@ -53,9 +53,13 @@ module ActionController #:nodoc: # class FooController < ApplicationController # protect_from_forgery :except => :index # - # # you can disable csrf protection on controller-by-controller basis: - # skip_before_filter :verify_authenticity_token - # end + # You can disable csrf protection on controller-by-controller basis: + # + # skip_before_filter :verify_authenticity_token + # + # It can also be disabled for specific controller actions: + # + # skip_before_filter :verify_authenticity_token, :except => [:create] # # Valid Options: # -- cgit v1.2.3 From 3ee0f0379cc0ae3dd44a050e35d644f1ad7a920b Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Sat, 27 Nov 2010 08:15:29 +1100 Subject: Add "Configuring Middleware" section to config guide, starting with mentioning what every bit of middleware does. --- railties/guides/source/configuring.textile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index 91c4c2b0f7..8187c647dd 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -67,6 +67,8 @@ h4. Rails General Configuration * +config.log_path+ overrides the path to the log file to use. Defaults to +log/#{environment}.log+ (e.g. log/development.log or log/production.log). +* +config.middleware+ allows you to configure the application's middleware. This is covered in depth in the "Configuring Middleware" section below. + * +config.logger+ accepts a logger conforming to the interface of Log4r or the default Ruby 1.8+ Logger class, which is then used to log information from Action Controller. Set to nil to disable logging. * +config.plugins+ accepts the list of plugins to load. If this is set to nil, all plugins will be loaded. If this is set to [], no plugins will be loaded. Otherwise, plugins will be loaded in the order specified. @@ -107,6 +109,29 @@ The full set of methods that can be used in this block are as follows: * +test_framework+ defines which test framework to use. Defaults to _nil_, so will use Test::Unit by default. * +template_engine+ defines which template engine to use, such as ERB or Haml. Defaults to +:erb+. +h4. Configuring Middleware + +Every Rails application comes with a standard set of middleware which it uses in this order in the development environment: + +* +ActionDispatch::Static+ is used to serve static assets. Disabled if +config.serve_static_assets+ is _true_. +* +Rack::Lock+ Will wrap the app in mutex so it can only be called by a single thread at a time. Only enabled if +config.action_controller.allow_concurrency+ is set to _false_, which it is by default. +* +ActiveSupport::Cache::Strategy::LocalCache+ Serves as a basic memory backed cache. This cache is not thread safe and is intended only for serving as a temporary memory cache for a single thread. +* +Rack::Runtime+ Sets an +X-Runtime+ header, containing the time (in seconds) taken to execute the request. +* +Rails::Rack::Logger+ Will notify the logs that the request has began. After request is complete, flushes all the logs. +* +ActionDispatch::ShowExceptions+ rescues any exception returned by the application and renders nice exception pages if the request is local or if +config.consider_all_requests_local+ is set to _true_. If +config.action_dispatch.show_exceptions+ is set to _false_, exceptions will be raised regardless. +* +ActionDispatch::RemoteIp+ checks for IP spoofing attacks. Configurable with the +config.action_dispatch.ip_spoofing_check+ and +config.action_dispatch.trusted_proxies+ settings. +* +Rack::Sendfile+ The Sendfile middleware intercepts responses whose body is being served from a file and replaces it with a server specific X-Sendfile header. Configurable with +config.action_dispatch_ +* +ActionDispatch::Callbacks+ Runs the prepare callbacks before serving the request. +* +ActiveRecord::ConnectionAdapters::ConnectionManagement+ cleans active connections after each request, unless the +rack.test+ key in the request environment is set to _true_. +* +ActiveRecord::QueryCache+ caches all +SELECT+ queries generated in a request. If an +INSERT+ or +UPDATE+ takes place then the cache is cleaned. +* +ActionDispatch::Cookies+ sets cookies for the request. +* +ActionDispatch::Session::CookieStore+ is responsible for storing the session in cookies. An alternate middleware can be used for this by changing the +config.action_controller.session_store+ to an alternate value. Additionally, options passed to this can be configured by using +config.action_controller.session_options+. +* +ActionDispatch::Flash+ sets up the +flash+ keys. Only available if +config.action_controller.session_store+ is set to a value. +* +ActionDispatch::ParamsParser+ parses out parameters from the request into +params+ +* +Rack::MethodOverride+ allows the method to be overridden if +params[:_method]+ is set. This is the middleware which supports the PUT and DELETE HTTP method types. +* +ActionDispatch::Head+ converts HEAD requests to GET requests and serves them as so. +* +ActionDispatch::BestStandardsSupport+ enables "best standards support" so that IE8 renders some elements correctly. + h4. Configuring i18n -- cgit v1.2.3 From c8c95fc519f9d0e23e012d4434e6c3fe0f6e2a62 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Sat, 27 Nov 2010 08:29:29 +1100 Subject: Add methods for configuring middleware to config guide --- railties/guides/source/configuring.textile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index 8187c647dd..ca78cc0e6d 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -132,6 +132,29 @@ Every Rails application comes with a standard set of middleware which it uses in * +ActionDispatch::Head+ converts HEAD requests to GET requests and serves them as so. * +ActionDispatch::BestStandardsSupport+ enables "best standards support" so that IE8 renders some elements correctly. +Besides these usual middleware, you can add your own by using the +config.middleware.use+ method: + + + config.middleware.use Magical::Unicorns + + +This will put the +Magical::Unicorns+ middleware on the end of the stack. If you wish to put this middleware before another use +insert_before+: + + + config.middleware.insert_before ActionDispatch::Head, Magical::Unicorns + + +There's also +insert_after+ which will insert a middleware _after_ another: + + + config.middleware.insert_after ActionDispatch::Head, Magical::Unicorns + + +Middlewares can also be completely swapped out and replaced with others: + + + config.middleware.swap ActionDispatch::BestStandardsSupport, Magical::Unicorns + h4. Configuring i18n -- cgit v1.2.3