:language : Defaults to "en-US". :root_url : The HTML alternative that this feed is doubling for. Defaults to / on the current host. :url : The URL for this feed. Defaults to the current URL. :id : The id for this feed. Defaults to "tag:#{request.host},#{options }:#{request.fullpath.s...
The Inflector transforms words from singular to plural, class names to table names, modularized class names to ones without, and class names to foreign keys. The default inflections for pluralization, singularization, and uncountable words are kept in inflections.rb. The Rails core te...
instance method which will get called with the class that using that validator as its argument. This can be useful when there are prerequisites such as an
On shared hosts, Apache sometimes doesn’t pass authentication headers to FCGI instances. If your environment matches this description and you cannot authenticate, try this rule in your Apache setup:
are hooks into the life cycle of an Active Record object that allow you to trigger logic before or after an alteration of the object state. This can be used to make sure that associated and dependent objects are deleted when destroy is called (by overwriting before_destroy ) or to mas...
Each would be rendered and added as a separate part to the message, with the corresponding content type. The content type for the entire message is automatically set to multipart/alternative , which indicates that the email contains multiple different representations of the same email...
implementation assumes that the encoding of the string is UTF-8, if you want to handle different encodings you can write your own multibyte string handler and configure it through ActiveSupport::Multibyte.proxy_class
railties/lib/rails/test_help.rb railties/lib/rails/commands/benchmarker.rb railties/lib/rails/commands/profiler.rb railties/lib/rails/commands/plugin.rb actionpack/lib/action_controller/deprecated/performance_test.rb actionpack/lib/action_controller/deprecated/integration_test.rb acti...
Provides methods for converting numbers into formatted strings. Methods are provided for phone numbers, currency, percentage, precision, positional notation, file size and pretty printing. Most methods expect a number argument, and will return it unchanged if can’t be converted into a...
Specifies a new acronym. An acronym must be specified as it will appear in a camelized string. An underscore string that contains the acronym will retain the acronym when passed to `camelize`, `humanize`, or `titleize`. A camelized string that contains the acronym will maintain the ac...
If true, destroys any members from the attributes hash with a _destroy key and a value that evaluates to true (eg. 1, ‘1’, true, or ‘true’). This option is off by default. :reject_if Allows you to specify a Proc or a Symbol pointing to a method that checks whether a record should be b...
railties/lib/rails/test_help.rb railties/lib/rails/commands/benchmarker.rb railties/lib/rails/commands/profiler.rb railties/lib/rails/commands/plugin.rb actionpack/lib/action_controller/deprecated/performance_test.rb actionpack/lib/action_controller/deprecated/integration_test.rb acti...
<%= button_to "New", :action => "new" %> # => "<form method="post" action="/controller/new" class="button_to"> # <div><input value="New" type="submit" /></div> # </form>" <%= button_to "New", :action => "new", :form_class => "new-thing" %> # => "<form method="post" action="/controller...
For clarity’s sake: the precision is the number of significant digits, while the scale is the number of digits that can be stored following the decimal point. For example, the number 123.45 has a precision of 5 and a scale of 2. A decimal with a precision of 5 and a scale of 2 can ran...
In the example above “render” is the name of the event, and the rest is called the payload . The payload is a mechanism that allows instrumenters to pass extra information to subscribers. Payloads consist of a hash whose contents are arbitrary and generally depend on the event.
Starts a form tag that points the action to an url configured with url_for_options just like ActionController::Base#url_for. The method for the form defaults to POST. Options :multipart - If set to true, the enctype is set to "multipart/form-data". :method - The method to use when sub...
railties/lib/rails/test_help.rb railties/lib/rails/commands/benchmarker.rb railties/lib/rails/commands/profiler.rb railties/lib/rails/commands/plugin.rb actionpack/lib/action_controller/deprecated/performance_test.rb actionpack/lib/action_controller/deprecated/integration_test.rb acti...
actionpack/lib/action_dispatch/routing/mapper.rb actionpack/lib/action_dispatch/routing/routes_proxy.rb actionpack/lib/action_dispatch/routing/route_set.rb actionpack/lib/action_dispatch/routing/url_for.rb actionpack/lib/action_dispatch/routing/polymorphic_routes.rb actionpack/lib/act...
<LocationMatch "^/release-\d+/(images|javascripts|stylesheets)/.*$"> # Some browsers still send conditional-GET requests if there's a # Last-Modified header or an ETag header even if they haven't # reached the expiry date sent in the Expires header. Header unset Last-Modified Header u...
railties/lib/rails/test_help.rb railties/lib/rails/commands/benchmarker.rb railties/lib/rails/commands/profiler.rb railties/lib/rails/commands/plugin.rb actionpack/lib/action_controller/deprecated/performance_test.rb actionpack/lib/action_controller/deprecated/integration_test.rb acti...
Specifies a many-to-many relationship with another class. This associates two classes via an intermediate join table. Unless the join table is explicitly specified as an option, it is guessed using the lexical order of the class names. So a join between Developer and Project will give...
Force the request to this particular controller or specified actions to be under HTTPS protocol. Note that this method will not be effective on development environment. Options only - The callback should be run only for this action <tt>except<tt> - The callback should be run for all a...
Creates a Cycle object whose to_s method cycles through elements of an array every time it is called. This can be used for example, to alternate classes for table rows. You can use named cycles to allow nesting in loops. Passing a Hash as the last parameter with a :name key will creat...
<%= button_to "New", :action => "new" %> # => "<form method="post" action="/controller/new" class="button_to"> # <div><input value="New" type="submit" /></div> # </form>" <%= button_to "New", :action => "new", :form_class => "new-thing" %> # => "<form method="post" action="/controller...
is very useful in situations where a cache entry is used very frequently and is under heavy load. If a cache expires and due to heavy load seven different processes will try to read data natively and then they all will try to write to cache. To avoid that case the first process to fin...
Accepts a container (hash, array, enumerable, your type) and returns a string of option tags. Given a container where the elements respond to first and last (such as a two-element array), the “lasts” serve as option values and the “firsts” as option text. Hashes are turned into this f...
controls the top-level behavior of as_json . If true (the default) as_json will emit a single root node named after the object’s type. For example:
Additionally, the record being serialized will be passed to a Proc’s second parameter. This allows for ad hoc additions to the resultant document that incorporate the context of the record being serialized. And by leveraging the closure created by a Proc, #to_xml can be used to add el...
:conditions : An SQL fragment like "administrator = 1" or [ "user_name = ?", username ]. See conditions in the intro to ActiveRecord::Base . :joins : Either an SQL fragment for additional joins like "LEFT JOIN comments ON comments.post_id = id" (rarely needed) or named associations in...
In order for inheritance to work for the callback queues, you must specify the callbacks before specifying the associations. Otherwise, you might trigger the loading of a child before the parent has registered the callbacks and they won't be inherited.