Skip to content
This repository
Browse code

minor formatting fixes

  • Loading branch information...
commit ae7910fad44ff05cc9db6e1d13cd57c844e53e13 1 parent 80382c7
Vijay Dev vijaydev authored

Showing 1 changed file with 19 additions and 19 deletions. Show diff stats Hide diff stats

  1. +19 19 railties/guides/source/configuring.textile
38 railties/guides/source/configuring.textile
Source Rendered
@@ -42,9 +42,9 @@ h4. Rails General Configuration
42 42 * +config.after_initialize+ takes a block which will be ran _after_ Rails has finished initializing. Useful for configuring values set up by other initializers:
43 43
44 44 <ruby>
45   - config.after_initialize do
46   - ActionView::Base.sanitized_allowed_tags.delete 'div'
47   - end
  45 +config.after_initialize do
  46 + ActionView::Base.sanitized_allowed_tags.delete 'div'
  47 +end
48 48 </ruby>
49 49
50 50 * +config.allow_concurrency+ should be set to +true+ to allow concurrent (threadsafe) action processing. Set to +false+ by default. You probably don't want to call this one directly, though, because a series of other adjustments need to be made for threadsafe mode to work properly. Can also be enabled with +threadsafe!+.
@@ -115,7 +115,7 @@ WARNING: Threadsafe operation is incompatible with the normal workings of develo
115 115
116 116 * +config.time_zone+ sets the default time zone for the application and enables time zone awareness for Active Record.
117 117
118   -* +config.whiny_nils+ enables or disabled warnings when an methods of nil are invoked. Defaults to _false_.
  118 +* +config.whiny_nils+ enables or disables warnings when any methods of nil are invoked. Defaults to _true_ in development and test environments.
119 119
120 120 h4. Configuring Generators
121 121
@@ -131,12 +131,12 @@ Rails 3 allows you to alter what generators are used with the +config.generators
131 131 The full set of methods that can be used in this block are as follows:
132 132
133 133 * +force_plural+ allows pluralized model names. Defaults to _false_.
134   -* +helper+ defines whether or not to generate helpers. Defaults to _true_
  134 +* +helper+ defines whether or not to generate helpers. Defaults to _true_.
135 135 * +orm+ defines which orm to use. Defaults to _nil_, so will use Active Record by default.
136   -* +integration_tool+ defines which integration tool to use. Defaults to _nil_
137   -* +performance_tool+ defines which performance tool to use. Defaults to _nil_
  136 +* +integration_tool+ defines which integration tool to use. Defaults to _nil_.
  137 +* +performance_tool+ defines which performance tool to use. Defaults to _nil_.
138 138 * +resource_controller+ defines which generator to use for generating a controller when using +rails generate resource+. Defaults to +:controller+.
139   -* +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+
  139 +* +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+.
140 140 * +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.
141 141 * +test_framework+ defines which test framework to use. Defaults to _nil_, so will use Test::Unit by default.
142 142 * +template_engine+ defines which template engine to use, such as ERB or Haml. Defaults to +:erb+.
@@ -234,7 +234,7 @@ h4. Configuring Action Controller
234 234
235 235 * +config.action_controller.asset_path+ takes a block which configures where assets can be found. Shorter version of +config.action_controller.asset_path+.
236 236
237   -* +config.action_controller.page_cache_directory+ should be the document root for the web server and is set using <tt>Base.page_cache_directory = "/document/root"</tt>. For Rails, this directory has already been set to Rails.public_path (which is usually set to <tt>Rails.root + "/public"</tt>). Changing this setting can be useful to avoid naming conflicts with files in <tt>public/</tt>, but doing so will likely require configuring your web server to look in the new location for cached files.
  237 +* +config.action_controller.page_cache_directory+ should be the document root for the web server and is set using <tt>Base.page_cache_directory = "/document/root"</tt>. For Rails, this directory has already been set to +Rails.public_path+ (which is usually set to <tt>Rails.root + "/public"</tt>). Changing this setting can be useful to avoid naming conflicts with files in <tt>public/</tt>, but doing so will likely require configuring your web server to look in the new location for cached files.
238 238
239 239 * +config.action_controller.page_cache_extension+ configures the extension used for cached pages saved to +page_cache_directory+. Defaults to +.html+
240 240
@@ -252,7 +252,7 @@ h4. Configuring Action Controller
252 252
253 253 The caching code adds two additional settings:
254 254
255   -* +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"+).
  255 +* +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 <tt>Rails.root + "/public"</tt>).
256 256
257 257 * +ActionController::Base.page_cache_extension+ 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 +.html+.
258 258
@@ -280,7 +280,7 @@ h4. Configuring Action View
280 280
281 281 There are only a few configuration options for Action View, starting with four on +ActionView::Base+:
282 282
283   -* +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+.
  283 +* +config.action_view.debug_rjs+ specifies whether RJS responses should be wrapped in a try/catch block that alerts the caught exception (and then re-raises it). The default is +false+.
284 284
285 285 * +config.action_view.field_error_proc+ provides an HTML generator for displaying errors that come from Active Record. The default is <tt>Proc.new{ |html_tag, instance| %Q(%&lt;div class=&quot;field_with_errors&quot;&gt;#{html_tag}&lt;/div&gt;).html_safe }</tt>
286 286
@@ -290,7 +290,7 @@ There are only a few configuration options for Action View, starting with four o
290 290
291 291 * +config.action_view.erb_trim_mode+ gives the trim mode to be used by ERB. It defaults to +'-'+. See the "ERB documentation":http://www.ruby-doc.org/stdlib/libdoc/erb/rdoc/ for more information.
292 292
293   -* +config.action_view.javascript_expansions+ a hash containining expansions that can be used for javascript include tag. By default, this is defined as:
  293 +* +config.action_view.javascript_expansions+ is a hash containing expansions that can be used for the JavaScript include tag. By default, this is defined as:
294 294
295 295 <ruby>
296 296 config.action_view.javascript_expansions = { :defaults => ['prototype', 'effects', 'dragdrop', 'controls', 'rails'] }
@@ -302,7 +302,7 @@ However, you may add to this by defining others:
302 302 config.action_view.javascript_expansions[:jquery] = ["jquery", "jquery-ui"]
303 303 </ruby>
304 304
305   -Then this can be referenced in the view with the following code:
  305 +And can reference in the view with the following code:
306 306
307 307 <ruby>
308 308 <%= javascript_include_tag :jquery %>
@@ -374,9 +374,9 @@ h3. Rails Environment Settings
374 374
375 375 Some parts of Rails can also be configured externally by supplying environment variables. The following environment variables are recognized by various parts of Rails:
376 376
377   -* +ENV['RAILS_ENV']+ defines the Rails environment (production, development, test, and so on) that Rails will run under.
  377 +* +ENV["RAILS_ENV"]+ defines the Rails environment (production, development, test, and so on) that Rails will run under.
378 378
379   -* +ENV['RAILS_RELATIVE_URL_ROOT']+ is used by the routing code to recognize URLs when you deploy your application to a subdirectory.
  379 +* +ENV["RAILS_RELATIVE_URL_ROOT"]+ is used by the routing code to recognize URLs when you deploy your application to a subdirectory.
380 380
381 381 * +ENV["RAILS_ASSET_ID"]+ will override the default cache-busting timestamps that Rails generates for downloadable assets.
382 382
@@ -404,9 +404,9 @@ h4. +Rails::Railtie#initializer+
404 404 Rails has several initializers that run on startup that are all defined by using the +initializer+ method from +Rails::Railtie+. Here's an example of the +initialize_whiny_nils+ initializer from Active Support:
405 405
406 406 <ruby>
407   - initializer "active_support.initialize_whiny_nils" do |app|
408   - require 'active_support/whiny_nil' if app.config.whiny_nils
409   - end
  407 +initializer "active_support.initialize_whiny_nils" do |app|
  408 + require 'active_support/whiny_nil' if app.config.whiny_nils
  409 +end
410 410 </ruby>
411 411
412 412 The +initializer+ method takes three arguments with the first being the name for the initializer and the second being an options hash (not shown here) and the third being a block. The +:before+ key in the options hash can be specified to specify which initializer this new initializer must run before, and the +:after+ key will specify which initializer to run this initializer _after_.
@@ -442,7 +442,7 @@ Serves as a placeholder so that +:load_environment_config+ can be defined to run
442 442
443 443 *+i18n.callbacks+* In the development environment, sets up a +to_prepare+ callback which will call +I18n.reload!+ if any of the locales have changed since the last request. In production mode this callback will only run on the first request.
444 444
445   -*+active_support.initialize_whiny_nils+* Will require +active_support/whiny_nil+ if +config.whiny_nil+ is set to +true+. This file will output errors such as:
  445 +*+active_support.initialize_whiny_nils+* Will require +active_support/whiny_nil+ if +config.whiny_nils+ is set to +true+. This file will output errors such as:
446 446
447 447 <plain>
448 448 Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id

0 comments on commit ae7910f

Please sign in to comment.
Something went wrong with that request. Please try again.