aboutsummaryrefslogtreecommitdiffstats
path: root/railties/doc/guides/html/configuring.html
diff options
context:
space:
mode:
Diffstat (limited to 'railties/doc/guides/html/configuring.html')
-rw-r--r--railties/doc/guides/html/configuring.html119
1 files changed, 78 insertions, 41 deletions
diff --git a/railties/doc/guides/html/configuring.html b/railties/doc/guides/html/configuring.html
index 4aa3a0f545..ea5f162cb7 100644
--- a/railties/doc/guides/html/configuring.html
+++ b/railties/doc/guides/html/configuring.html
@@ -205,6 +205,9 @@ ul#navMain {
<a href="#_using_a_preinitializer">Using a Preinitializer</a>
</li>
<li>
+ <a href="#_initialization_process_settings">Initialization Process Settings</a>
+ </li>
+ <li>
<a href="#_configuring_rails_components">Configuring Rails Components</a>
<ul>
@@ -229,6 +232,9 @@ ul#navMain {
<a href="#_using_an_after_initializer">Using an After-Initializer</a>
</li>
<li>
+ <a href="#_rails_environment_settings">Rails Environment Settings</a>
+ </li>
+ <li>
<a href="#_changelog">Changelog</a>
</li>
</ol>
@@ -264,26 +270,81 @@ after-initializer</p></div>
<h2 id="_using_a_preinitializer">2. Using a Preinitializer</h2>
<div class="sectionbody">
</div>
-<h2 id="_configuring_rails_components">3. Configuring Rails Components</h2>
+<h2 id="_initialization_process_settings">3. Initialization Process Settings</h2>
+<div class="sectionbody">
+</div>
+<h2 id="_configuring_rails_components">4. Configuring Rails Components</h2>
<div class="sectionbody">
-<h3 id="_configuring_active_record">3.1. Configuring Active Record</h3>
-<h3 id="_configuring_action_controller">3.2. Configuring Action Controller</h3>
-<h3 id="_configuring_action_view">3.3. Configuring Action View</h3>
-<h3 id="_configuring_action_mailer">3.4. Configuring Action Mailer</h3>
-<h3 id="_configuring_active_resource">3.5. Configuring Active Resource</h3>
-<h3 id="_configuring_active_support">3.6. Configuring Active Support</h3>
+<h3 id="_configuring_active_record">4.1. Configuring Active Record</h3>
+<div class="para"><p><tt>ActiveRecord::Base</tt> includej a variety of configuration options:</p></div>
+<div class="para"><p><tt>logger</tt> accepts a logger conforming to the interface of Log4r or the default Ruby 1.8+ Logger class, which is then passed on to any new database connections made. You can retrieve this logger by calling <tt>logger</tt> on either an ActiveRecord model class or an ActiveRecord model instance. Set to nil to disable logging.</p></div>
+<div class="para"><p><tt>primary_key_prefix_type</tt> lets you adjust the naming for primary key columns. By default, Rails assumes that primary key columns are named <tt>id</tt> (and this configuration option doesn't need to be set.) There are two other choices:</p></div>
+<div class="ilist"><ul>
+<li>
+<p>
+<tt>:table_name</tt> would make the primary key for the Customer class <tt>customerid</tt>
+</p>
+</li>
+<li>
+<p>
+<tt>:table_name_with_underscore</tt> would make the primary key for the Customer class <tt>customer_id</tt>
+</p>
+</li>
+</ul></div>
+<div class="para"><p><tt>table_name_prefix</tt> lets you set a global string to be prepended to table names. If you set this to <tt>northwest_</tt>, then the Customer class will look for <tt>northwest_customers</tt> as its table. The default is an empty string.</p></div>
+<div class="para"><p><tt>table_name_suffix</tt> lets you set a global string to be appended to table names. If you set this to <tt>_northwest</tt>, then the Customer class will look for <tt>customers_northwest</tt> as its table. The default is an empty string.</p></div>
+<div class="para"><p><tt>pluralize_table_names</tt> specifies whether Rails will look for singular or plural table names in the database. If set to <tt>true</tt> (the default), then the Customer class will use the <tt>customers</tt> table. If set to <tt>false</tt>, then the Customers class will use the <tt>customer</tt> table.</p></div>
+<div class="para"><p><tt>colorize_logging</tt> (true by default) specifies whether or not to use ANSI color codes when logging information from ActiveRecord.</p></div>
+<div class="para"><p><tt>default_timezone</tt> determines whether to use <tt>Time.local</tt> (if set to <tt>:local</tt>) or <tt>Time.utc</tt> (if set to <tt>:utc</tt>) when pulling dates and times from the database. The default is <tt>:local</tt>.</p></div>
+<div class="para"><p><tt>schema_format</tt> controls the format for dumping the database schema to a file. The options are <tt>:ruby</tt> (the default) for a database-independent version that depends on migrations, or <tt>:sql</tt> for a set of (potentially database-dependent) SQL statements.</p></div>
+<div class="para"><p><tt>timestamped_migrations</tt> controls whether migrations are numbered with serial integers or with timestamps. The default is <tt>true</tt>, to use timestamps, which are preferred if there are multiple developers working on the same application.</p></div>
+<div class="para"><p><tt>lock_optimistically</tt> controls whether ActiveRecord will use optimistic locking. By default this is <tt>true</tt>.</p></div>
+<div class="para"><p>The MySQL adapter adds one additional configuration option:</p></div>
+<div class="para"><p><tt>ActiveRecord::ConnectionAdapters::MysqlAdapter.emulate_booleans</tt> controls whether ActiveRecord will consider all <tt>tinyint(1)</tt> columns in a MySQL database to be booleans. By default this is <tt>true</tt>.</p></div>
+<div class="para"><p>The schema dumper adds one additional configuration option:</p></div>
+<div class="para"><p><tt>ActiveRecord::SchemaDumper.ignore_tables</tt> accepts an array of tables that should <em>not</em> be included in any generated schema file. This setting is ignored unless <tt>ActiveRecord::Base.schema_format == :ruby</tt>.</p></div>
+<h3 id="_configuring_action_controller">4.2. Configuring Action Controller</h3>
+<div class="para"><p>ActionController::Base includes a number of configuration settings:</p></div>
+<div class="para"><p><tt>asset_host</tt> provides a string that is prepended to all of the URL-generating helpers in <tt>AssetHelper</tt>. This is designed to allow moving all javascript, CSS, and image files to a separate asset host.</p></div>
+<div class="para"><p><tt>consider_all_requests_local</tt> is generally set to <tt>true</tt> during development and <tt>false</tt> during production; if it is set to <tt>true</tt>, then any error will cause detailed debugging information to be dumped in the HTTP response. For finer-grained control, set this to <tt>false</tt> and implement <tt>local_request?</tt> to specify which requests should provide debugging information on errors.</p></div>
+<div class="para"><p><tt>allow_concurrency</tt> should be set to <tt>true</tt> to allow concurrent (threadsafe) action processing. Set to <tt>false</tt> by default.</p></div>
+<div class="para"><p><tt>param_parsers</tt> provides an array of handlers that can extract information from incoming HTTP requests and add it to the <tt>params</tt> hash. By default, parsers for multipart forms, URL-encoded forms, XML, and JSON are active.</p></div>
+<div class="para"><p><tt>default_charset</tt> specifies the default character set for all renders. The default is "utf-8".</p></div>
+<div class="para"><p><tt>logger</tt> 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.</p></div>
+<div class="para"><p><tt>resource_action_separator</tt> gives the token to be used between resources and actions when building or interpreting RESTful URLs. By default, this is "/".</p></div>
+<div class="para"><p><tt>resource_path_names</tt> is a hash of default names for several RESTful actions. By default, the new action is named <tt>new</tt> and the edit action is named <tt>edit</tt>.</p></div>
+<div class="para"><p><tt>request_forgery_protection_token</tt> sets the token parameter name for RequestForgery. Calling <tt>protect_from_forgery</tt> sets it to <tt>:authenticity_token</tt> by default.</p></div>
+<div class="para"><p><tt>optimise_named_routes</tt> turns on some optimizations in generating the routing table. It is set to <tt>true</tt> by default.</p></div>
+<div class="para"><p><tt>use_accept_header</tt> sets the rules for determining the response format. If this is set to <tt>true</tt> (the default) then <tt>respond_to</tt> and <tt>Request#format</tt> will take the Accept header into account. If it is set to false then the request format will be determined solely by examining <tt>params[:format]</tt>. If there is no <tt>format</tt> parameter, then the response format will be either HTML or Javascript depending on whether the request is an AJAX request.</p></div>
+<div class="para"><p><tt>allow_forgery_protection</tt> enables or disables CSRF protection. By default this is <tt>false</tt> in test mode and <tt>true</tt> in all other modes.</p></div>
+<div class="para"><p><tt>relative_url_root</tt> can be used to tell Rails that you are deploying to a subdirectory. The default is <tt>ENV[<em>RAILS_RELATIVE_URL_ROOT</em>]</tt>.</p></div>
+<div class="para"><p>The caching code adds two additional settings:</p></div>
+<div class="para"><p><tt>ActionController::Caching::Pages.page_cache_directory</tt> sets the directory where Rails will create cached pages for your web server. The default is <tt>Rails.public_path</tt> (which is usually set to <tt>RAILS_ROOT </tt> "/public"+).</p></div>
+<div class="para"><p><tt>ActionController::Caching::Pages.page_cache_extension</tt> sets the extension to be used when generating pages for the cache (this is ignored if the incoming request already has an extension). The default is <tt>.html</tt>.</p></div>
+<div class="para"><p>The dispatcher includes one setting:</p></div>
+<div class="para"><p><tt>ActionController::Dispatcher.error_file_path</tt> gives the path where Rails will look for error files such as <tt>404.html</tt>. The default is <tt>Rails.public_path</tt>.</p></div>
+<div class="para"><p>The Active Record session store can also be configured:</p></div>
+<div class="para"><p><tt>CGI::Session::ActiveRecordStore::Session.data_column_name</tt> sets the name of the column to use to store session data. By default it is <em>data</em></p></div>
+<h3 id="_configuring_action_view">4.3. Configuring Action View</h3>
+<h3 id="_configuring_action_mailer">4.4. Configuring Action Mailer</h3>
+<h3 id="_configuring_active_resource">4.5. Configuring Active Resource</h3>
+<h3 id="_configuring_active_support">4.6. Configuring Active Support</h3>
</div>
-<h2 id="_using_initializers">4. Using Initializers</h2>
+<h2 id="_using_initializers">5. Using Initializers</h2>
<div class="sectionbody">
<div class="literalblock">
<div class="content">
<pre><tt>organization, controlling load order</tt></pre>
</div></div>
</div>
-<h2 id="_using_an_after_initializer">5. Using an After-Initializer</h2>
+<h2 id="_using_an_after_initializer">6. Using an After-Initializer</h2>
+<div class="sectionbody">
+</div>
+<h2 id="_rails_environment_settings">7. Rails Environment Settings</h2>
<div class="sectionbody">
+<div class="para"><p>ENV</p></div>
</div>
-<h2 id="_changelog">6. Changelog</h2>
+<h2 id="_changelog">8. Changelog</h2>
<div class="sectionbody">
<div class="para"><p><a href="http://rails.lighthouseapp.com/projects/16213-rails-guides/tickets/28">Lighthouse ticket</a></p></div>
<div class="ilist"><ul>
@@ -366,37 +427,6 @@ November 5, 2008: Rough outline by <a href="../authors.html#mgunderloy">Mike Gun
<div class="para"><p>activerecord/lib/active_record/attribute_methods.rb
9: base.cattr_accessor :attribute_types_cached_by_default, :instance_writer &#8658; false
11: base.cattr_accessor :time_zone_aware_attributes, :instance_writer &#8658; false</p></div>
-<div class="para"><p>activerecord/lib/active_record/base.rb
-394: cattr_accessor :logger, :instance_writer &#8658; false
-443: cattr_accessor :configurations, :instance_writer &#8658; false
-450: cattr_accessor :primary_key_prefix_type, :instance_writer &#8658; false
-456: cattr_accessor :table_name_prefix, :instance_writer &#8658; false
-461: cattr_accessor :table_name_suffix, :instance_writer &#8658; false
-467: cattr_accessor :pluralize_table_names, :instance_writer &#8658; false
-473: cattr_accessor :colorize_logging, :instance_writer &#8658; false
-478: cattr_accessor :default_timezone, :instance_writer &#8658; false
-487: cattr_accessor :schema_format , :instance_writer &#8658; false
-491: cattr_accessor :timestamped_migrations , :instance_writer &#8658; false</p></div>
-<div class="para"><p>activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb
-11: cattr_accessor :connection_handler, :instance_writer &#8658; false</p></div>
-<div class="para"><p>activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
-166: cattr_accessor :emulate_booleans</p></div>
-<div class="para"><p>activerecord/lib/active_record/fixtures.rb
-498: cattr_accessor :all_loaded_fixtures</p></div>
-<div class="para"><p>activerecord/lib/active_record/locking/optimistic.rb
-38: base.cattr_accessor :lock_optimistically, :instance_writer &#8658; false</p></div>
-<div class="para"><p>activerecord/lib/active_record/migration.rb
-259: cattr_accessor :verbose</p></div>
-<div class="para"><p>activerecord/lib/active_record/schema_dumper.rb
-13: cattr_accessor :ignore_tables</p></div>
-<div class="para"><p>activerecord/lib/active_record/serializers/json_serializer.rb
-4: base.cattr_accessor :include_root_in_json, :instance_writer &#8658; false</p></div>
-<div class="para"><p>activerecord/Rakefile
-142: rdoc.options &lt;&lt; <em>&#8212;line-numbers</em> &lt;&lt; <em>&#8212;inline-source</em> &lt;&lt; <em>-A cattr_accessor=object</em></p></div>
-<div class="para"><p>activerecord/test/cases/lifecycle_test.rb
-61: cattr_reader :last_inherited</p></div>
-<div class="para"><p>activerecord/test/cases/mixin_test.rb
-9: cattr_accessor :forced_now_time</p></div>
<div class="para"><p>activeresource/lib/active_resource/base.rb
206: cattr_accessor :logger</p></div>
<div class="para"><p>activeresource/Rakefile
@@ -430,6 +460,13 @@ November 5, 2008: Rough outline by <a href="../authors.html#mgunderloy">Mike Gun
12: cattr_accessor :local_request</p></div>
<div class="para"><p>Rakefile
32: rdoc.options &lt;&lt; <em>-A cattr_accessor=object</em></p></div>
+<div class="qlist"><ol>
+<li>
+<p><em>
+need to look for def self. ?
+</em></p>
+</li>
+</ol></div>
</div>
</div>