mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Changed several instances of British English to be American English
This commit is contained in:
parent
662a71b09f
commit
66b4d11236
8 changed files with 10 additions and 10 deletions
|
@ -422,7 +422,7 @@ The above will send a multipart email with an attachment, properly nested with t
|
||||||
|
|
||||||
h3. Receiving Emails
|
h3. Receiving Emails
|
||||||
|
|
||||||
Receiving and parsing emails with Action Mailer can be a rather complex endeavour. Before your email reaches your Rails app, you would have had to configure your system to somehow forward emails to your app, which needs to be listening for that. So, to receive emails in your Rails app you'll need to:
|
Receiving and parsing emails with Action Mailer can be a rather complex endeavor. Before your email reaches your Rails app, you would have had to configure your system to somehow forward emails to your app, which needs to be listening for that. So, to receive emails in your Rails app you'll need to:
|
||||||
|
|
||||||
* Implement a +receive+ method in your mailer.
|
* Implement a +receive+ method in your mailer.
|
||||||
|
|
||||||
|
|
|
@ -848,7 +848,7 @@ The way form fields with errors are treated is defined by +ActionView::Base.fiel
|
||||||
* A string with the HTML tag
|
* A string with the HTML tag
|
||||||
* An instance of +ActionView::Helpers::InstanceTag+.
|
* An instance of +ActionView::Helpers::InstanceTag+.
|
||||||
|
|
||||||
Here is a simple example where we change the Rails behaviour to always display the error messages in front of each of the form fields with errors. The error messages will be enclosed by a +span+ element with a +validation-error+ CSS class. There will be no +div+ element enclosing the +input+ element, so we get rid of that red border around the text field. You can use the +validation-error+ CSS class to style it anyway you want.
|
Here is a simple example where we change the Rails behavior to always display the error messages in front of each of the form fields with errors. The error messages will be enclosed by a +span+ element with a +validation-error+ CSS class. There will be no +div+ element enclosing the +input+ element, so we get rid of that red border around the text field. You can use the +validation-error+ CSS class to style it anyway you want.
|
||||||
|
|
||||||
<ruby>
|
<ruby>
|
||||||
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
|
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
|
||||||
|
@ -941,7 +941,7 @@ The +after_initialize+ callback will be called whenever an Active Record object
|
||||||
|
|
||||||
The +after_find+ callback will be called whenever Active Record loads a record from the database. +after_find+ is called before +after_initialize+ if both are defined.
|
The +after_find+ callback will be called whenever Active Record loads a record from the database. +after_find+ is called before +after_initialize+ if both are defined.
|
||||||
|
|
||||||
The +after_initialize+ and +after_find+ callbacks are a bit different from the others. They have no +before_*+ counterparts, and the only way to register them is by defining them as regular methods. If you try to register +after_initialize+ or +after_find+ using macro-style class methods, they will just be ignored. This behaviour is due to performance reasons, since +after_initialize+ and +after_find+ will both be called for each record found in the database, significantly slowing down the queries.
|
The +after_initialize+ and +after_find+ callbacks are a bit different from the others. They have no +before_*+ counterparts, and the only way to register them is by defining them as regular methods. If you try to register +after_initialize+ or +after_find+ using macro-style class methods, they will just be ignored. This behavior is due to performance reasons, since +after_initialize+ and +after_find+ will both be called for each record found in the database, significantly slowing down the queries.
|
||||||
|
|
||||||
<ruby>
|
<ruby>
|
||||||
class User < ActiveRecord::Base
|
class User < ActiveRecord::Base
|
||||||
|
@ -1172,7 +1172,7 @@ As usual, settings in +config/environments+ take precedence over those in +confi
|
||||||
|
|
||||||
h4. Sharing Observers
|
h4. Sharing Observers
|
||||||
|
|
||||||
By default, Rails will simply strip "Observer" from an observer's name to find the model it should observe. However, observers can also be used to add behaviour to more than one model, and so it's possible to manually specify the models that our observer should observe.
|
By default, Rails will simply strip "Observer" from an observer's name to find the model it should observe. However, observers can also be used to add behavior to more than one model, and so it's possible to manually specify the models that our observer should observe.
|
||||||
|
|
||||||
<ruby>
|
<ruby>
|
||||||
class MailerObserver < ActiveRecord::Observer
|
class MailerObserver < ActiveRecord::Observer
|
||||||
|
|
|
@ -500,7 +500,7 @@ ActionController::TestCase.class_eval do
|
||||||
end
|
end
|
||||||
</ruby>
|
</ruby>
|
||||||
|
|
||||||
Rails uses +alias_method_chain+ all over the code base. For example validations are added to +ActiveRecord::Base#save+ by wrapping the method that way in a separate module specialised in validations.
|
Rails uses +alias_method_chain+ all over the code base. For example validations are added to +ActiveRecord::Base#save+ by wrapping the method that way in a separate module specialized in validations.
|
||||||
|
|
||||||
NOTE: Defined in +active_support/core_ext/module/aliasing.rb+.
|
NOTE: Defined in +active_support/core_ext/module/aliasing.rb+.
|
||||||
|
|
||||||
|
|
|
@ -397,7 +397,7 @@ config.action_dispatch.x_sendfile_header = "X-Sendfile" # Use 'X-Accel-Redirect'
|
||||||
|
|
||||||
You should check that your server or hosting service actually supports this, otherwise comment it out.
|
You should check that your server or hosting service actually supports this, otherwise comment it out.
|
||||||
|
|
||||||
WARNING: If you are upgrading an existing application and intend to use this option, take care to paste this configuration option only into +production.rb+ (and not +application.rb+) and any other environment you define with production behaviour.
|
WARNING: If you are upgrading an existing application and intend to use this option, take care to paste this configuration option only into +production.rb+ (and not +application.rb+) and any other environment you define with production behavior.
|
||||||
|
|
||||||
h3. How Caching Works
|
h3. How Caching Works
|
||||||
|
|
||||||
|
|
|
@ -443,7 +443,7 @@ class CreateAssemblyPartJoinTable < ActiveRecord::Migration
|
||||||
end
|
end
|
||||||
</ruby>
|
</ruby>
|
||||||
|
|
||||||
We pass +:id => false+ to +create_table+ because that table does not represent a model. That's required for the association to work properly. If you observe any strange behaviour in a +has_and_belongs_to_many+ association like mangled models IDs, or exceptions about conflicting IDs chances are you forgot that bit.
|
We pass +:id => false+ to +create_table+ because that table does not represent a model. That's required for the association to work properly. If you observe any strange behavior in a +has_and_belongs_to_many+ association like mangled models IDs, or exceptions about conflicting IDs chances are you forgot that bit.
|
||||||
|
|
||||||
h4. Controlling Association Scope
|
h4. Controlling Association Scope
|
||||||
|
|
||||||
|
|
|
@ -523,7 +523,7 @@ The error occurred while evaluating nil.each
|
||||||
|
|
||||||
*+action_view.cache_asset_ids+* Sets +ActionView::Helpers::AssetTagHelper::AssetPaths.cache_asset_ids+ to +false+ when Active Support loads, but only if +config.cache_classes+ is too.
|
*+action_view.cache_asset_ids+* Sets +ActionView::Helpers::AssetTagHelper::AssetPaths.cache_asset_ids+ to +false+ when Active Support loads, but only if +config.cache_classes+ is too.
|
||||||
|
|
||||||
*+action_view.javascript_expansions+* Registers the expansions set up by +config.action_view.javascript_expansions+ and +config.action_view.stylesheet_expansions+ to be recognised by Action View and therefore usable in the views.
|
*+action_view.javascript_expansions+* Registers the expansions set up by +config.action_view.javascript_expansions+ and +config.action_view.stylesheet_expansions+ to be recognized by Action View and therefore usable in the views.
|
||||||
|
|
||||||
*+action_view.set_configs+* Sets up Action View by using the settings in +config.action_view+ by +send+'ing the method names as setters to +ActionView::Base+ and passing the values through.
|
*+action_view.set_configs+* Sets up Action View by using the settings in +config.action_view+ by +send+'ing the method names as setters to +ActionView::Base+ and passing the values through.
|
||||||
|
|
||||||
|
|
|
@ -512,7 +512,7 @@ h4. +railties/lib/rails/ruby_version_check.rb+
|
||||||
|
|
||||||
This file simply checks if the Ruby version is less than 1.8.7 or is 1.9.1 and raises an error if that is the case. Rails 3 simply will not run on earlier versions of Ruby than 1.8.7 or 1.9.1.
|
This file simply checks if the Ruby version is less than 1.8.7 or is 1.9.1 and raises an error if that is the case. Rails 3 simply will not run on earlier versions of Ruby than 1.8.7 or 1.9.1.
|
||||||
|
|
||||||
NOTE: You should always endeavour to run the latest version of Ruby with your Rails applications. The benefits are many, including security fixes and the like, and very often there is a speed increase associated with it. The caveat is that you could have code that potentially breaks on the latest version, which should be fixed to work on the latest version rather than kept around as an excuse not to upgrade.
|
NOTE: You should always endeavor to run the latest version of Ruby with your Rails applications. The benefits are many, including security fixes and the like, and very often there is a speed increase associated with it. The caveat is that you could have code that potentially breaks on the latest version, which should be fixed to work on the latest version rather than kept around as an excuse not to upgrade.
|
||||||
|
|
||||||
h4. +active_support/core_ext/kernel/reporting.rb+
|
h4. +active_support/core_ext/kernel/reporting.rb+
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,7 @@ NOTE: The actual rendering is done by subclasses of +ActionView::TemplateHandler
|
||||||
|
|
||||||
h4. Using +render+
|
h4. Using +render+
|
||||||
|
|
||||||
In most cases, the +ActionController::Base#render+ method does the heavy lifting of rendering your application's content for use by a browser. There are a variety of ways to customise the behaviour of +render+. You can render the default view for a Rails template, or a specific template, or a file, or inline code, or nothing at all. You can render text, JSON, or XML. You can specify the content type or HTTP status of the rendered response as well.
|
In most cases, the +ActionController::Base#render+ method does the heavy lifting of rendering your application's content for use by a browser. There are a variety of ways to customize the behaviour of +render+. You can render the default view for a Rails template, or a specific template, or a file, or inline code, or nothing at all. You can render text, JSON, or XML. You can specify the content type or HTTP status of the rendered response as well.
|
||||||
|
|
||||||
TIP: If you want to see the exact results of a call to +render+ without needing to inspect it in a browser, you can call +render_to_string+. This method takes exactly the same options as +render+, but it returns a string instead of sending a response back to the browser.
|
TIP: If you want to see the exact results of a call to +render+ without needing to inspect it in a browser, you can call +render_to_string+. This method takes exactly the same options as +render+, but it returns a string instead of sending a response back to the browser.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue