Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Add docs for ActionDispatch::Http::URL methods | claudiob | 2014-12-18 | 1 | -0/+109 |
| | | | | | | | | | | Add docs for `extract_domain`, `extract_subdomains`, `extract_subdomain`. Add doc examples for `url`, `protocol`, `raw_host_with_port`, `host`, `host_with_port`, `port`, `standard_port`, `standard_port?`, `optional_port`, `port_string`. [ci skip] | ||||
* | Anchor should not be appended when set to nil/false. | Guo Xiang Tan | 2014-11-23 | 1 | -1/+3 |
| | | | | Fixes https://github.com/rails/rails/issues/17714. | ||||
* | Realign assignments :scissors: | Carlos Antonio da Silva | 2014-07-31 | 1 | -5/+5 |
| | |||||
* | Do not reassign variable when mutation is happening | Carlos Antonio da Silva | 2014-07-31 | 1 | -8/+5 |
| | | | | | These methods mutate the path variable/argument so there is no need to reassign it every time. | ||||
* | Only concatenate path if it was given rather than converting blindly | Carlos Antonio da Silva | 2014-07-31 | 1 | -1/+1 |
| | |||||
* | Rename variable to better show its intent | Carlos Antonio da Silva | 2014-07-31 | 1 | -12/+12 |
| | |||||
* | Simplify conditional | Carlos Antonio da Silva | 2014-07-31 | 1 | -3/+2 |
| | |||||
* | Push options check up so we can simplify internal methods | Carlos Antonio da Silva | 2014-07-31 | 1 | -13/+10 |
| | |||||
* | use a strategy object for generating urls in named helpers | Aaron Patterson | 2014-07-17 | 1 | -8/+13 |
| | | | | | | since we know that the route should be a path or fully qualified, we can pass a strategy object that handles generation. This allows us to eliminate an "if only_path" branch when generating urls. | ||||
* | extract path building to a method | Aaron Patterson | 2014-07-16 | 1 | -9/+11 |
| | |||||
* | break out path building logic to methods | Aaron Patterson | 2014-07-16 | 1 | -14/+22 |
| | |||||
* | only extract :params from the options hash once | Aaron Patterson | 2014-07-16 | 1 | -3/+2 |
| | |||||
* | push host / port / protocol extraction up | Aaron Patterson | 2014-06-30 | 1 | -6/+6 |
| | | | | Then we only need to extract host once. | ||||
* | add both branches to the only_path conditional | Aaron Patterson | 2014-06-19 | 1 | -6/+6 |
| | |||||
* | only check named_host? once in normalize_host | Aaron Patterson | 2014-06-12 | 1 | -3/+7 |
| | |||||
* | lookup subdomain from the options hash once, defaulting to true | Aaron Patterson | 2014-06-12 | 1 | -2/+2 |
| | | | | | 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. | ||||
* | only extract domain from the options hash once | Aaron Patterson | 2014-06-12 | 1 | -3/+4 |
| | |||||
* | reduce calls to `named_host?` | Aaron Patterson | 2014-06-12 | 1 | -2/+6 |
| | | | | | `normalize_host` already calls `named_host?`, so there is no reason to test `named_host?` again in the `extract_domain` method. | ||||
* | Removed warning actionpack url.rb | Juanito Fatas | 2014-06-12 | 1 | -2/+2 |
| | | | | | | | | | | Before: /Users/Juan/dev/rails/actionpack/lib/action_dispatch/http/url.rb:95: warning: shadowing outer local variable - port After: No warning | ||||
* | remove useless to_param call | Aaron Patterson | 2014-06-11 | 1 | -1/+1 |
| | | | | | extract_subdomain always returns a string, and to_param calls to_s on a string | ||||
* | only look up the subdomain once | Aaron Patterson | 2014-06-11 | 1 | -3/+4 |
| | |||||
* | scheme should contain one or more characters | Aaron Patterson | 2014-06-11 | 1 | -1/+1 |
| | |||||
* | pull the port out of the options hash once | Aaron Patterson | 2014-06-11 | 1 | -2/+3 |
| | |||||
* | remove useless nil check | Aaron Patterson | 2014-06-11 | 1 | -2/+2 |
| | | | | | | | | | irb(main):004:0> /foo/ !~ nil => true irb(main):005:0> /foo/ !~ 'bar' => true irb(main):006:0> /foo/ !~ 'foo' => false | ||||
* | these methods are always called with a tld_parameter | Aaron Patterson | 2014-06-11 | 1 | -3/+3 |
| | | | | | remove the default parameter since the methods are always called with a parameter | ||||
* | rm `same_host?`. The same conditional is two lines down. | Aaron Patterson | 2014-06-11 | 1 | -5/+3 |
| | |||||
* | Revert "rm `same_host?`. The same conditional is two lines down." | Aaron Patterson | 2014-06-11 | 1 | -5/+8 |
| | | | | This reverts commit 79469b4b0c05a50e19699bc9b568042add2d4987. | ||||
* | rm `same_host?`. The same conditional is two lines down. | Aaron Patterson | 2014-06-11 | 1 | -8/+5 |
| | |||||
* | cache host on the stack so we only look it up once | Aaron Patterson | 2014-06-11 | 1 | -8/+9 |
| | |||||
* | only pull :protocol from the options hash once | Aaron Patterson | 2014-06-11 | 1 | -2/+3 |
| | |||||
* | cache protocol on the stack to reduce options hash lookups | Aaron Patterson | 2014-06-11 | 1 | -7/+7 |
| | |||||
* | eliminate nil checks in normalize_port | Aaron Patterson | 2014-06-11 | 1 | -7/+7 |
| | |||||
* | reduce hash lookups and disconnect normalize_port from the options hash | Aaron Patterson | 2014-06-11 | 1 | -9/+9 |
| | |||||
* | Merge pull request #14986 from dlangevin/trailing-slash-url-generation | Rafael Mendonça França | 2014-05-24 | 1 | -7/+13 |
|\ | | | | | | | | | | | | | Fixes URL generation with trailing_slash: true Conflicts: actionpack/lib/action_dispatch/http/url.rb | ||||
| * | Fixes URL generation with trailing_slash: true | Dan Langevin | 2014-05-22 | 1 | -9/+17 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 | ||||
* | | fewer string allocations per url_for | Aaron Patterson | 2014-05-20 | 1 | -7/+5 |
| | | |||||
* | | mutate the path string to avoid object allocations | Aaron Patterson | 2014-05-20 | 1 | -4/+4 |
| | | |||||
* | | push only_path conditional up | Aaron Patterson | 2014-05-20 | 1 | -18/+19 |
| | | |||||
* | | push arg checking up | Aaron Patterson | 2014-05-20 | 1 | -4/+4 |
| | | |||||
* | | fewer method calls and string garbage when there is no user/password | Aaron Patterson | 2014-05-20 | 1 | -9/+5 |
| | | |||||
* | | Always use the provided port for protocol relative urls | Andrew White | 2014-05-11 | 1 | -0/+2 |
| | | | | | | | | | | 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. | ||||
* | | ActionDispatch::Http::URL.normalize_port should not strip port for protocol ↵ | Guilherme Cavalcanti | 2014-05-11 | 1 | -2/+0 |
| | | | | | | | | relative URL. | ||||
* | | skip dealing with params if none are provided | Aaron Patterson | 2014-05-09 | 1 | -4/+11 |
| | | | | | | | | | | | | | | | | | | | | | | 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. | ||||
* | | don't mutate the options hash, so we don't have to dup | Aaron Patterson | 2014-05-09 | 1 | -4/+3 |
| | | | | | | | | avoids extra hash allocations on each call | ||||
* | | use unless and || since these options are boolean | Aaron Patterson | 2014-05-09 | 1 | -1/+1 |
|/ | |||||
* | Refactor ActionDispatch::Http::URL.build_host_url | Andrew White | 2013-04-18 | 1 | -20/+49 |
| | | | | | Add support for extracting the port from the :host option and for removing the subdomain by using nil, false or ''. | ||||
* | Duplicate options before mutating them | Andrew White | 2013-04-18 | 1 | -0/+1 |
| | |||||
* | Passing subdomain: '' to url_for removes the subdomain (instead of adding a ↵ | Derek Watson | 2013-04-18 | 1 | -1/+1 |
| | | | | | | leading .) Adding a boolean route constraint checks for presence/absence of request property | ||||
* | Fix improperly configured host in generated urls | schneems | 2013-03-19 | 1 | -1/+12 |
| | | | | | | | | | | | | | | | | | | | 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 | ||||
* | Require AS deps in ActionDispatch::Http::URL | Miha Filej | 2013-02-19 | 1 | -0/+3 |
| | | | | Allows us to use url_for and friends in isolation. |