| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
if the subdomain wasn't specified, it's the same as if specifying
:subdomain as `true`, so we can default the value to `true` safely.
|
| |
|
|
|
|
|
| |
`normalize_host` already calls `named_host?`, so there is no reason to
test `named_host?` again in the `extract_domain` method.
|
|
|
|
|
|
|
|
|
|
| |
Before:
/Users/Juan/dev/rails/actionpack/lib/action_dispatch/http/url.rb:95: warning: shadowing outer local variable - port
After:
No warning
|
|
|
|
|
| |
extract_subdomain always returns a string, and to_param calls to_s on a
string
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
irb(main):004:0> /foo/ !~ nil
=> true
irb(main):005:0> /foo/ !~ 'bar'
=> true
irb(main):006:0> /foo/ !~ 'foo'
=> false
|
|
|
|
|
| |
remove the default parameter since the methods are always called with a
parameter
|
| |
|
|
|
|
| |
This reverts commit 79469b4b0c05a50e19699bc9b568042add2d4987.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| | |
Fixes URL generation with trailing_slash: true
Conflicts:
actionpack/lib/action_dispatch/http/url.rb
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
URL generation with trailing_slash: true was adding a trailing slash
after .:format
Routes.draw do
resources :bars
end
bars_url(trailing_slash: true, format: 'json')
# => /bars.json/
This commit removes that extra trailing slash
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
There may be situations where you need to tunnel SSL connections over
port 80 so we shouldn't remove it if it has been explicitly provided.
|
| |
| |
| |
| | |
relative URL.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This lets us avoid
1. A slow call to Hash#slice
2. An is_a? test
3. Extra hash allocations (from slice)
4. String allocations
etc.
|
| |
| |
| |
| | |
avoids extra hash allocations on each call
|
|/ |
|
|
|
|
|
| |
Add support for extracting the port from the :host option and for
removing the subdomain by using nil, false or ''.
|
| |
|
|
|
|
|
|
| |
leading .)
Adding a boolean route constraint checks for presence/absence of request property
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the host in `default_url_options` is accidentally set with a protocol such as
```
host: "http://example.com"
```
then the generated url will have the protocol twice `http://http://example.com` which is not what the user intended. Likely they wanted to define a host `host: "example.com"` and a `protocol: "http://"` but did not know the convention.
This may not the most common problem, but when it happens it can go undetected for a while. I accidentally added `http://` out of habit recently only to find all the links in my emails were broken after deploying a demo site to production. Rather than allow this accident go undetected, we can fix the problem in line by properly setting the protocol and host.
I was able to find this related question on stack overflow: http://stackoverflow.com/questions/5878329/rails-3-devise-how-do-i-make-the-email-confirmation-links-use-secure-https-n where the answer was highly upvoted.
This is based off of work in #7415 cc/ @pixeltrix
ATP Action Mailer and Action Pack
|
|
|
|
| |
Allows us to use url_for and friends in isolation.
|
| |
|
| |
|
|
|
|
| |
Merge url for tests and add changelog entry for #8233.
|
|
|
|
|
|
| |
With a "params" argument, the following error is raised:
undefined method `reject!` for "":String
|
|
|
|
|
|
| |
Use if..else conditions instead of return guards.
Use _ for not used arguments when iterating.
Set the path variable directly instead of using an empty string and <<.
|
| |
|
| |
|
|
|
|
|
| |
Separated right side url generation(before query string)
from left side url generation(after query string)
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
* e.g. blog_url(subdomain: current_user) instead of blog_url(subdomain: current_user.to_param)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
numeric addresses.
See-also pull request #3561 from 3-1-stable
Otherwise the following occurs:
TypeError: can't convert nil into String
/Users/bfolkens/dev/bfolkens-rails-core/actionpack/lib/action_dispatch/http/url.rb:75:in host_or_subdomain_and_domain'
/Users/bfolkens/dev/bfolkens-rails-core/actionpack/lib/action_dispatch/http/url.rb:37:in url_for'
/Users/bfolkens/dev/bfolkens-rails-core/actionpack/lib/action_dispatch/routing/url_for.rb:147:in test_subdomain_may_be_accepted_with_numeric_host'
/Users/bfolkens/dev/bfolkens-rails-core/activesupport/lib/active_support/testing/setup_and_teardown.rb:67:in run'
/Users/bfolkens/dev/bfolkens-rails-core/activesupport/lib/active_support/callbacks.rb:426:in send'
/Users/bfolkens/dev/bfolkens-rails-core/activesupport/lib/active_support/callbacks.rb:81:in run'
|