A few documentation tweaks [ci skip]
[Robin Dupret & Shunsuke Aida]
This commit is contained in:
parent
c429674f86
commit
27eccc27cb
@ -228,7 +228,7 @@ def request_id=(id) # :nodoc:
|
||||
|
||||
alias_method :uuid, :request_id
|
||||
|
||||
def x_request_id # :nodoc
|
||||
def x_request_id # :nodoc:
|
||||
@env[HTTP_X_REQUEST_ID]
|
||||
end
|
||||
|
||||
@ -259,7 +259,7 @@ def body
|
||||
end
|
||||
end
|
||||
|
||||
# returns true if request content mime type is
|
||||
# Returns true if the request's content MIME type is
|
||||
# +application/x-www-form-urlencoded+ or +multipart/form-data+.
|
||||
def form_data?
|
||||
FORM_DATA_MEDIA_TYPES.include?(content_mime_type.to_s)
|
||||
|
@ -662,7 +662,7 @@ def index_name_exists?(table_name, index_name, default)
|
||||
# [<tt>:foreign_key</tt>]
|
||||
# Add an appropriate foreign key. Defaults to false.
|
||||
# [<tt>:polymorphic</tt>]
|
||||
# Wether an additional +_type+ column should be added. Defaults to false.
|
||||
# Whether an additional +_type+ column should be added. Defaults to false.
|
||||
#
|
||||
# ====== Create a user_id integer column
|
||||
#
|
||||
|
@ -39,8 +39,8 @@ class Deprecation
|
||||
}
|
||||
|
||||
# Behavior module allows to determine how to display deprecation messages.
|
||||
# You can set any behaviors from +DEFAULT_BEHAVIORS+ constant or create
|
||||
# custom behavior. Available behaviors:
|
||||
# You can create a custom behavior or set any from the +DEFAULT_BEHAVIORS+
|
||||
# constant. Available behaviors are:
|
||||
#
|
||||
# [+raise+] Raise <tt>ActiveSupport::DeprecationException</tt>.
|
||||
# [+stderr+] Log all deprecation warnings to +$stderr+.
|
||||
@ -49,7 +49,7 @@ class Deprecation
|
||||
# [+silence+] Do nothing.
|
||||
#
|
||||
# Setting behaviors only affects deprecations that happen after boot time.
|
||||
# For more information you can read documentation for +behavior=+ method.
|
||||
# For more information you can read the documentation of the +behavior=+ method.
|
||||
module Behavior
|
||||
# Whether to print a backtrace along with the warning.
|
||||
attr_accessor :debug
|
||||
|
@ -127,7 +127,7 @@ def initialize(old_const, new_const, deprecator = ActiveSupport::Deprecation.ins
|
||||
@deprecator = deprecator
|
||||
end
|
||||
|
||||
# Returns class of a new constant.
|
||||
# Returns the class of the new constant.
|
||||
#
|
||||
# PLANETS_POST_2006 = %w(mercury venus earth mars jupiter saturn uranus neptune)
|
||||
# PLANETS = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('PLANETS', 'PLANETS_POST_2006')
|
||||
|
@ -39,7 +39,7 @@ def unstub_object(stub)
|
||||
end
|
||||
end
|
||||
|
||||
# Contain helpers that help you test passage of time.
|
||||
# Contains helpers that help you test passage of time.
|
||||
module TimeHelpers
|
||||
# Changes current time to the time in the future or in the past by a given time difference by
|
||||
# stubbing +Time.now+, +Date.today+, and +DateTime.now+.
|
||||
|
@ -1473,7 +1473,8 @@ The `collection.clear` method removes all objects from the collection according
|
||||
@customer.orders.clear
|
||||
```
|
||||
|
||||
WARNING: Objects will be delete if they're associated with `dependent: :destroy`, just like `dependent: :delete_all`.
|
||||
WARNING: Objects will be deleted if they're associated with `dependent: :destroy`,
|
||||
just like `dependent: :delete_all`.
|
||||
|
||||
##### `collection.empty?`
|
||||
|
||||
@ -1512,7 +1513,7 @@ The `collection.where` method finds objects within the collection based on the c
|
||||
|
||||
##### `collection.exists?(...)`
|
||||
|
||||
The `collection.exists?` method checks whether an object meeting the supplied
|
||||
The `collection.exists?` method checks whether an object meeting the supplied
|
||||
conditions exists in the collection. It uses the same syntax and options as
|
||||
[`ActiveRecord::Base.exists?`](http://api.rubyonrails.org/classes/ActiveRecord/FinderMethods.html#method-i-exists-3F).
|
||||
|
||||
|
@ -186,7 +186,8 @@ The full set of methods that can be used in this block are as follows:
|
||||
* `javascript_engine` configures the engine to be used (for eg. coffee) when generating assets. Defaults to `:js`.
|
||||
* `orm` defines which orm to use. Defaults to `false` and will use Active Record by default.
|
||||
* `resource_controller` defines which generator to use for generating a controller when using `rails generate resource`. Defaults to `:controller`.
|
||||
* `resource_route` defines whether inject resource route definition in routes or not. Defaults to `true`.
|
||||
* `resource_route` defines whether a resource route definition should be generated
|
||||
or not. Defaults to `true`.
|
||||
* `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 run, but this hook can be used in other generates as well. Defaults to `true`.
|
||||
* `stylesheet_engine` configures the stylesheet engine (for eg. sass) to be used when generating assets. Defaults to `:css`.
|
||||
|
@ -500,7 +500,10 @@ You can make use of this feature, e.g. when working with a large amount of stati
|
||||
|
||||
### Organization of Locale Files
|
||||
|
||||
When you are using the default SimpleStore shipped with the i18n library, dictionaries are stored in plain-text files on the disc. Putting translations for all parts of your application in one file per locale could be hard to manage. You can store these files in a hierarchy which makes sense to you.
|
||||
When you are using the default SimpleStore shipped with the i18n library,
|
||||
dictionaries are stored in plain-text files on the disk. Putting translations
|
||||
for all parts of your application in one file per locale could be hard to
|
||||
manage. You can store these files in a hierarchy which makes sense to you.
|
||||
|
||||
For example, your `config/locales` directory could look like this:
|
||||
|
||||
|
@ -809,13 +809,16 @@ As long as `Sprockets` responds to `call` and returns a `[status, headers, body]
|
||||
|
||||
NOTE: For the curious, `'articles#index'` actually expands out to `ArticlesController.action(:index)`, which returns a valid Rack application.
|
||||
|
||||
If you specify a rack application as the endpoint for a matcher remember that the route will be unchanged in the receiving application. With the following route your rack application should expect the route to be '/admin':
|
||||
If you specify a Rack application as the endpoint for a matcher, remember that
|
||||
the route will be unchanged in the receiving application. With the following
|
||||
route your Rack application should expect the route to be '/admin':
|
||||
|
||||
```ruby
|
||||
match '/admin', to: AdminApp, via: :all
|
||||
```
|
||||
|
||||
If you would prefer to have your rack application receive requests at the root path instead use mount:
|
||||
If you would prefer to have your Rack application receive requests at the root
|
||||
path instead, use mount:
|
||||
|
||||
```ruby
|
||||
mount AdminApp, at: '/admin'
|
||||
|
Loading…
Reference in New Issue
Block a user