mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
[ci skip] Change 'an URL' to 'a URL' as URL doesn't have a vowel sound
This commit is contained in:
parent
9e25e0e173
commit
148d1217a1
8 changed files with 9 additions and 9 deletions
|
@ -482,7 +482,7 @@ module ActionDispatch
|
|||
# resources :user, param: :name
|
||||
#
|
||||
# You can override <tt>ActiveRecord::Base#to_param</tt> of a related
|
||||
# model to construct an URL:
|
||||
# model to construct a URL:
|
||||
#
|
||||
# class User < ActiveRecord::Base
|
||||
# def to_param
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
module ActionDispatch
|
||||
module Routing
|
||||
# In <tt>config/routes.rb</tt> you define URL-to-controller mappings, but the reverse
|
||||
# is also possible: an URL can be generated from one of your routing definitions.
|
||||
# is also possible: a URL can be generated from one of your routing definitions.
|
||||
# URL generation functionality is centralized in this module.
|
||||
#
|
||||
# See ActionDispatch::Routing for general information about routing and routes.rb.
|
||||
|
|
|
@ -20,7 +20,7 @@ module ActionView
|
|||
mattr_accessor :embed_authenticity_token_in_remote_forms
|
||||
self.embed_authenticity_token_in_remote_forms = false
|
||||
|
||||
# Starts a form tag that points the action to an url configured with <tt>url_for_options</tt> just like
|
||||
# Starts a form tag that points the action to a url configured with <tt>url_for_options</tt> just like
|
||||
# ActionController::Base#url_for. The method for the form defaults to POST.
|
||||
#
|
||||
# ==== Options
|
||||
|
|
|
@ -15,7 +15,7 @@ module ActiveRecord
|
|||
self.cache_timestamp_format = :nsec
|
||||
end
|
||||
|
||||
# Returns a String, which Action Pack uses for constructing an URL to this
|
||||
# Returns a String, which Action Pack uses for constructing a URL to this
|
||||
# object. The default implementation returns this record's id as a String,
|
||||
# or nil if this record's unsaved.
|
||||
#
|
||||
|
|
|
@ -1247,7 +1247,7 @@ file_field_tag 'attachment'
|
|||
|
||||
#### form_tag
|
||||
|
||||
Starts a form tag that points the action to an url configured with `url_for_options` just like `ActionController::Base#url_for`.
|
||||
Starts a form tag that points the action to a url configured with `url_for_options` just like `ActionController::Base#url_for`.
|
||||
|
||||
```html+erb
|
||||
<%= form_tag '/articles' do %>
|
||||
|
|
|
@ -249,7 +249,7 @@ end
|
|||
|
||||
With this approach you will not get a `Routing Error` when accessing your resources such as `http://localhost:3001/books` without a locale. This is useful for when you want to use the default locale when one is not specified.
|
||||
|
||||
Of course, you need to take special care of the root URL (usually "homepage" or "dashboard") of your application. An URL like `http://localhost:3001/nl` will not work automatically, because the `root to: "books#index"` declaration in your `routes.rb` doesn't take locale into account. (And rightly so: there's only one "root" URL.)
|
||||
Of course, you need to take special care of the root URL (usually "homepage" or "dashboard") of your application. A URL like `http://localhost:3001/nl` will not work automatically, because the `root to: "books#index"` declaration in your `routes.rb` doesn't take locale into account. (And rightly so: there's only one "root" URL.)
|
||||
|
||||
You would probably need to map URLs like these:
|
||||
|
||||
|
|
|
@ -1096,7 +1096,7 @@ Video.find_by(identifier: params[:identifier])
|
|||
```
|
||||
|
||||
You can override `ActiveRecord::Base#to_param` of a related model to construct
|
||||
an URL:
|
||||
a URL:
|
||||
|
||||
```ruby
|
||||
class Video < ActiveRecord::Base
|
||||
|
|
|
@ -301,7 +301,7 @@ This will redirect the user to the main action if they tried to access a legacy
|
|||
http://www.example.com/site/legacy?param1=xy¶m2=23&host=www.attacker.com
|
||||
```
|
||||
|
||||
If it is at the end of the URL it will hardly be noticed and redirects the user to the attacker.com host. A simple countermeasure would be to _include only the expected parameters in a legacy action_ (again a whitelist approach, as opposed to removing unexpected parameters). _And if you redirect to an URL, check it with a whitelist or a regular expression_.
|
||||
If it is at the end of the URL it will hardly be noticed and redirects the user to the attacker.com host. A simple countermeasure would be to _include only the expected parameters in a legacy action_ (again a whitelist approach, as opposed to removing unexpected parameters). _And if you redirect to a URL, check it with a whitelist or a regular expression_.
|
||||
|
||||
#### Self-contained XSS
|
||||
|
||||
|
@ -406,7 +406,7 @@ NOTE: _Almost every web application has to deal with authorization and authentic
|
|||
|
||||
There are a number of authentication plug-ins for Rails available. Good ones, such as the popular [devise](https://github.com/plataformatec/devise) and [authlogic](https://github.com/binarylogic/authlogic), store only encrypted passwords, not plain-text passwords. In Rails 3.1 you can use the built-in `has_secure_password` method which has similar features.
|
||||
|
||||
Every new user gets an activation code to activate their account when they get an e-mail with a link in it. After activating the account, the activation_code columns will be set to NULL in the database. If someone requested an URL like these, they would be logged in as the first activated user found in the database (and chances are that this is the administrator):
|
||||
Every new user gets an activation code to activate their account when they get an e-mail with a link in it. After activating the account, the activation_code columns will be set to NULL in the database. If someone requested a URL like these, they would be logged in as the first activated user found in the database (and chances are that this is the administrator):
|
||||
|
||||
```
|
||||
http://localhost:3006/user/activate
|
||||
|
|
Loading…
Reference in a new issue