aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing
Commit message (Collapse)AuthorAgeFilesLines
* allow URL helpers to work with optional scopesAlex Robbin2014-12-131-1/+1
|
* Fix handling of positional url helper arguments when format is falseTatiana Soukiassian2014-12-131-2/+8
| | | | | | | There is no need to subtract one from the path_params size when there is no format parameter because it is not present in the path_params array. Fixes #17819.
* Only check that it is a Rails application onceRafael Mendonça França2014-12-081-5/+7
| | | | Also avoid using try since is_a? is faster for this case.
* Mounted Rack apps should have default named routes based on app nameT.J. Schuck2014-12-061-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a regression in 4.2.0 from 4.1.8. https://github.com/rails/rails/pull/17823 fixed a similar regression regarding _explicitly_ named routes for a mounted Rack app, but there was another regression for the default value. With a route like: Rails.application.routes.draw do mount Mountable::Web, at: 'some_route' end The "Prefix" column of rake routes gives the following: - 4.1.8: mountable_web - 4.2.0.beta1-4: [nothing] - 4.2.0.rc1: [nothing] - 4.2.0.rc2: some_route <- regression This fixes the default to go back to being based off the name of the class like the docs specify: https://github.com/rails/rails/blob/785d04e3109f69d0b9b9f4732179592f0ef04e52/actionpack/lib/action_dispatch/routing/mapper.rb#L558-L560 Explicitly named routes still work correctly per https://github.com/rails/rails/pull/17823: Rails.application.routes.draw do mount Mountable::Web, at: 'some_route', as: 'named' end - 4.1.8: named - 4.2.0.beta1-4: [nothing] - 4.2.0.rc1: [nothing] - 4.2.0.rc2: named
* Merge pull request #17862 from lucasmazza/lm-hide-actionRafael Mendonça França2014-12-021-0/+2
| | | | `_generate_paths_by_default` should always be private.
* Merge pull request #17823 from byroot/fix-mount-rack-apps-with-asSean Griffin2014-11-291-7/+1
|\ | | | | Pure rack apps can be mounted with a name
| * Pure rack apps can be mounted with a nameJean Boussier2014-11-291-7/+1
| | | | | | | | See https://github.com/rails/rails/commit/9b15828b5c347395b42066a588c88e5eb4e72279#commitcomment-8764492
* | Pass symbol as an argument instead of a blockErik Michaels-Ober2014-11-292-5/+3
|/
* Refactor nested ifBruno Sutic2014-11-261-5/+3
|
* sets script_name to always be a string.JONBRWN2014-11-251-1/+1
| | | | | | | | | | | Closes #17615 #17616 when script_name is nil in the options hash, script_name is set to nil. options = {script_name: nil} script_name = options.delete(:script_name) {‘’} # => nil Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Merge branch 'deprecate-string-options-in-url-helpers'Sean Griffin2014-11-241-1/+17
|\
| * Deprecate string options in URL helpersMelanie Gilman2014-11-241-1/+17
| | | | | | | | | | | | Fixes https://github.com/rails/rails/issues/16958 [Byron Bischoff & Melanie Gilman]
* | let mailer templates generate URLs by default [Xavier Noria, Richard Schneeman]Xavier Noria2014-11-242-2/+12
|/
* Wrap code snippets in +, not backticks, in sdocclaudiob2014-11-201-3/+3
| | | | [ci skip]
* Remove redundant `to_s` in interpolationclaudiob2014-10-301-1/+1
|
* edit pass over all warningsXavier Noria2014-10-282-3/+15
| | | | | | | | | | | | | | | This patch uniformizes warning messages. I used the most common style already present in the code base: * Capitalize the first word. * End the message with a full stop. * "Rails 5" instead of "Rails 5.0". * Backticks for method names and inline code. Also, converted a few long strings into the new heredoc convention.
* let's warn with heredocsXavier Noria2014-10-281-11/+14
| | | | | | | | | | | | The current style for warning messages without newlines uses concatenation of string literals with manual trailing spaces where needed. Heredocs have better readability, and with `squish` we can still produce a single line. This is a similar use case to the one that motivated defining `strip_heredoc`, heredocs are super clean.
* Typos in the deprecation messageGodfrey Chan2014-10-281-2/+2
|
* Deprecate the `only_path` option on `*_path` helpers.Godfrey Chan2014-10-281-2/+26
| | | | | | | | | | | | In cases where this option is set to `true`, the option is redundant and can be safely removed; otherwise, the corresponding `*_url` helper should be used instead. Fixes #17294. See also #17363. [Dan Olson, Godfrey Chan]
* Fix typo in actionpack/lib/action_dispatch/routing/mapper.rbYuutetu2014-10-161-1/+1
|
* Revert "Merge pull request #16966 from why-el/symbolize-path-params"Rafael Mendonça França2014-09-251-1/+0
| | | | | | | | This reverts commit 9d05d6de52871e57bfbf54a60de005e8a5f5b0e4, reversing changes made to 0863c9248fd47a15e88e05ce4fcd80966684c0e3. The change in the behaviour reported at #16958 doesn't exist since 4.0 and 4.1 works in the same way
* Ensure named path params are symbols (Fixes #16958)Mohamed Wael Khobalatte2014-09-251-0/+1
|
* Keep the original implementation to not having to allocate new objectsRafael Mendonça França2014-09-251-2/+15
|
* Remove internal options from query string of pathsGert Goet2014-09-251-18/+3
| | | | Fixes #17057
* Allow polymorphic routes with nil when a route can still be drawnSammy Larbi2014-08-311-1/+2
| | | | | | | | | | | | | | | | Suppose you have two resources routed in the following manner: ```ruby resources :blogs do resources :posts end resources :posts ``` When using polymorphic resource routing like `url_for([@blog, @post])`, and `@blog` is `nil` Rails should still try to match the route to the top-level posts resource. Fixes #16754
* Don't ignore constraints in redirect routesAgis-2014-08-251-2/+0
| | | | | | | | https://github.com/rails/rails/commit/402c2af55053c2f29319091ad21fd6fa6b90ee89 introduced a regression that caused any constraints added to redirect routes to be ignored. Fixes #16605
* Merge pull request #15889 from carnesmedia/model-nameRafael Mendonça França2014-08-171-5/+5
|\ | | | | | | Use #model_name on instances instead of classes
| * Use #model_name on instances instead of classesAmiel Martin2014-06-241-5/+5
| | | | | | | | | | | | This allows rails code to be more confdent when asking for a model name, instead of having to ask for the class. Rails core discussion here: https://groups.google.com/forum/#!topic/rubyonrails-core/ThSaXw9y1F8
* | Deprecate NamedRouteCollection#helpers.Lucas Mazza2014-08-171-0/+5
| | | | | | | | | | | | This method was removed at 210b338db20b1cdd0684f40bd78b52ed16148b99 but it is used by third party gems to check if a named route was defined. To help on the upgrade path on 4.2.0 we bring it back and emit a deprecation warning.
* | extract methods and metaprogram less.Aaron Patterson2014-08-141-11/+16
| |
* | ask the scope object if it is a resource_method_scopeAaron Patterson2014-08-131-10/+13
| |
* | ask the scope for the action nameAaron Patterson2014-08-131-14/+18
| |
* | reduce calls to scope_levelAaron Patterson2014-08-131-1/+5
| | | | | | | | | | this will help us to encapsulate magical symbols so hopefully we can eliminate hardcoded magic symbols
* | change to attr_readerAaron Patterson2014-08-131-5/+1
| |
* | scope_level is no longer a hash key, just use the ivarAaron Patterson2014-08-131-4/+9
| |
* | move the scope level key fully inside the scope objectAaron Patterson2014-08-131-1/+5
| |
* | move scope_level to a method on the scope objectAaron Patterson2014-08-131-7/+20
| | | | | | | | now we don't have to have a hard coded key
* | only look up scope level onceAaron Patterson2014-08-131-6/+7
| | | | | | | | avoid hash lookups and remove depency on the instance
* | only test `prefix` onceAaron Patterson2014-08-131-2/+4
| | | | | | | | we don't need to repeat if statements
* | pass consistent parameters to canonical_action?Aaron Patterson2014-08-131-5/+5
| | | | | | | | | | now we only have to look up @scope[:scope_level] once per call to canonical_action? and we don't have a variable named "flag"
* | fewer operations on the options hashAaron Patterson2014-08-131-10/+10
| | | | | | | | | | since we pass `as` down, then we won't have to do an insert / delete dance with the options hash
* | avoid testing only_pathAaron Patterson2014-08-041-0/+4
| | | | | | | | | | we know that this call only wants the path returned, so lets call a method that returns the path.
* | always return a string from find_script_nameAaron Patterson2014-08-012-7/+9
| | | | | | | | this allows us to avoid nil checks on the return value
* | use `get` instead of accessing the named routes internalsAaron Patterson2014-07-311-1/+1
| |
* | invert check so we fail fasterAaron Patterson2014-07-311-1/+1
| | | | | | | | | | there's no reason to to_sym the string if it doesn't match the regexp anyway
* | do a hash lookup for collision detectionAaron Patterson2014-07-312-1/+5
| | | | | | | | hash lookup should be faster than searching an array.
* | remove useless deupAaron Patterson2014-07-301-1/+1
| | | | | | | | | | every call to default_resources_path_names allocates a new hash, no need to dup
* | push options inside the scope objectAaron Patterson2014-07-301-4/+9
| |
* | turn scope in to a linked listAaron Patterson2014-07-301-15/+36
| | | | | | | | this makes scope rollback much easier
* | remove alias_method_chainAaron Patterson2014-07-301-4/+2
| | | | | | | | we can `super` in to the previous implementation.