aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/mapper.rb
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #8412 from ↵Rafael Mendonça França2012-12-051-18/+14
|\ | | | | | | | | JoeyButler/action_dispatch_routing_mapper_refactoring Extract method refactoring.
| * Extract method refactoring in ActionDispatch::Routing::SingletonResource.Joey Butler2012-12-051-18/+14
| |
* | Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-12-041-4/+0
|\ \ | | | | | | | | | | | | Conflicts: guides/source/migrations.md
| * | Cleans and removes useless 'Examples' tag [ci skip]Alvaro Pereyra2012-12-011-4/+0
| |/
* / Fixed issue where routes with globs caused constraints on that glob toMaura Fitzgerald2012-12-041-1/+1
|/ | | | | | be ignored. A regular expression constraint gets overwritten when the routes.rb file is processed. Changed the overwriting to an ||= instead of an = assignment.
* Refector a bit to remove extra slice iteration and splat callCarlos Antonio da Silva2012-11-241-2/+2
| | | | | | | | | This yields a small bit of performance improvement when building the defaults from constraints, specially considering that it's rather common for constraints to be empty. Also, there's a bit of duplicated code in here that I have to check before extracting.
* Use merge! in some places to avoid creating extra hashesCarlos Antonio da Silva2012-11-241-3/+3
|
* Simplify scope options recovery by using merge!Carlos Antonio da Silva2012-11-241-6/+1
| | | | | | Instead of iterating again over the options and setting one by one, we can just merge the recover hash back to the scope one since all keys match.
* Normalize scope recovering :blocks option nameCarlos Antonio da Silva2012-11-241-3/+3
| | | | | Use the same :blocks key in the recover hash to revert the scope options later.
* Simplify constraints condition in scope when checking for HashCarlos Antonio da Silva2012-11-241-7/+4
|
* Allow setting a symbol as path in scope on routesGuillermo Iguaran2012-11-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Was surprising found that this example doesn't work: scope :api do resources :users end and the right form to use it is: scope 'api' do resources :users end I think this should work similary as `namespace` where both are allowed. These two are equivalent: namespace :api do resources :users end namespace 'api' do resources :user end
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-11-171-17/+22
|\ | | | | | | | | Conflicts: actionpack/lib/action_dispatch/routing/redirection.rb
| * update syntax and add note about prompt use of HttpHelpers [ci-skip]Cesar Carruitero2012-11-091-12/+17
| |
| * correct link syntax [ci-skip]Cesar Carruitero2012-11-091-5/+5
| |
* | routing prefix slash replacement is no longer necessaryYves Senn2012-11-041-3/+1
|/
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-11-031-55/+55
|\ | | | | | | | | | | | | Conflicts: actionpack/lib/action_controller/metal/mime_responds.rb activerecord/lib/active_record/attribute_methods.rb guides/source/working_with_javascript_in_rails.md
| * 1.9 hash syntax changes to docsAvnerCohen2012-10-311-55/+55
| |
* | Revert "Merge pull request #7668 from Draiken/fix_issue_6497"Rafael Mendonça França2012-11-021-1/+1
|/ | | | | | | | | | | | | | This reverts commit f4ad0ebe7a6b17658bddfeb996e3c34835b75623, reversing changes made to 8b2cbb3a832101f0e672ee309beca0f8c555b292. Conflicts: actionpack/CHANGELOG.md REASON: This added introduced a bug when you have a shorthand route inside a nested namespace. See https://github.com/rafaelfranca/rails/commit/281367eb770faf8077c1fd6194188e92ed1637a1
* resource and resources do no longer modify passed optionsYves Senn2012-10-011-2/+2
| | | | this is a patch for #7777.
* Removing to_shorthand from default_controller_and_action. Fixes #6497Luiz Felipe2012-09-191-1/+1
| | | | | When using shortcut routes inside an engine the "to_shorthand" variable is set to true, causing the module scope of the route to not be applied.
* Make enhanced routing Concerns more tell-don't-askErnie Miller2012-09-031-25/+55
|
* Fix concerns not executing block in mapperErnie Miller2012-09-031-2/+19
| | | | Also, add documentation for alternate usage.
* Allow routing concerns to accept a callableErnie Miller2012-09-031-3/+7
| | | | | | This allows us to make alterations to the generated routes based on the scope of the current mapper, and otherwise allows us to move larger blocks of concerns out of the routes file, altogether.
* Update actionpack/lib/action_dispatch/routing/mapper.rbErik Ordway2012-08-291-1/+1
| | | escape the '.'s  
* Make sure :via works with mountPratik Naik2012-08-201-2/+3
|
* Add CHANGELOG entry and documentation for Routing ConcernsRafael Mendonça França2012-08-131-0/+38
|
* Implementing Routing ConcernsRafael Mendonça França2012-08-131-1/+23
| | | | | | | This pattern was introduced as a plugin by @dhh. The original implementation can be found in https://github.com/rails/routing_concerns
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-08-041-0/+8
|\ | | | | | | | | | | Conflicts: activemodel/lib/active_model/secure_password.rb activerecord/lib/active_record/associations/collection_proxy.rb
| * copy edits [ci skip]Vijay Dev2012-08-041-2/+2
| |
| * fix punctuation in #resources and #match documentation [ci skip]Francesco Rodriguez2012-07-311-4/+4
| |
| * Update #match documentation [ci skip]Robert Pankowecki2012-07-311-0/+4
| |
| * Update #resources documentation [ci skip]Robert Pankowecki2012-07-311-0/+4
| |
* | load active_support/core_ext/object/blank in active_support/railsXavier Noria2012-08-021-1/+0
|/
* Don't assume resource param is :id when using shallow routesAndrew White2012-07-201-1/+3
| | | | | Since #5581 added support for resources with custom params we should not assume that it is :id when using shallow resource routing.
* Support constraints on resource custom params when nestingAndrew White2012-07-201-8/+12
| | | | | | | The Mapper looks for a :id constraint in the scope to see whether it should apply a constraint for nested resources. Since #5581 added support for resource params other than :id, we need to check for a constraint on the parent resource's param name and not assume it's :id.
* Add support for optional root segments containing slashesAndrew White2012-07-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Optional segments with a root scope need to have the leading slash outside of the parentheses, otherwise the generated url will be empty. However if the route has non-optional elements then the leading slash needs to remain inside the parentheses otherwise the generated url will have two leading slashes, e.g: Blog::Application.routes.draw do get '/(:category)', :to => 'posts#index', :as => :root get '/(:category)/author/:name', :to => 'posts#author', :as => :author end $ rake routes root GET /(:category)(.:format) posts#index author GET (/:category)/author/:name(.:format) posts#author This change adds support for optional segments that contain a slash, allowing support for urls like /page/2 for the root path, e.g: Blog::Application.routes.draw do get '/(page/:page)', :to => 'posts#index', :as => :root end $ rake routes root GET /(page/:page)(.:format) posts#index Fixes #7073
* Raise a helpful error message on #mount misuseCarl Lerche2012-07-101-0/+4
|
* Revert "Allow loading external route files from the router"José Valim2012-06-291-17/+0
| | | | | | | | | | | | | | This reverts commit 6acebb38bc0637bc05c19d87f8767f16ce79189b. Usage of this feature did not reveal any improvement in existing apps. Conflicts: actionpack/lib/action_dispatch/routing/mapper.rb guides/source/routing.textile railties/lib/rails/engine.rb railties/lib/rails/paths.rb railties/test/paths_test.rb
* Support unicode character route in config/routes.rb.kennyj2012-06-161-1/+1
|
* Include routes.mounted_helpers into integration testsPiotr Sarnacki2012-06-011-1/+1
| | | | | | | | | | | | | | | In integration tests, you might want to use helpers from engines that you mounted in your application. It's not hard to add it by yourself, but it's unneeded boilerplate. mounted_helpers are now included by default. That means that given engine mounted like: mount Foo::Engine => "/foo", :as => "foo" you will be able to use paths from this engine in tests this way: foo.root_path #=> "/foo" (closes #6573)
* Remove implicit dependency on pathnameJosé Valim2012-05-251-3/+3
|
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-05-151-11/+0
|\ | | | | | | | | Conflicts: actionpack/lib/action_view/helpers/asset_tag_helper.rb
| * Removing ==Examples and last blank lines of docs from actionpackFrancesco Rodriguez2012-05-151-11/+0
| |
* | add tests and external file backtrace for Routing::Mapper#drawKornelius Kalnbach2012-05-151-3/+4
|/
* Copy literal route constraints to defaults - fixes #3571 and #6224.Andrew White2012-05-111-0/+19
|
* Force given path to http methods in mapper to skip canonical action checkingCarlos Antonio da Silva2012-05-041-2/+3
| | | | | | | | | | | | | | | This fixes the following scenario: resources :contacts do post 'new', action: 'new', on: :collection, as: :new end Where the /new path is not generated because it's considered a canonical action, part of the normal resource actions: new_contacts POST /contacts(.:format) contacts#new Fixes #2999
* Reset the request parameters after a constraints checkAndrew White2012-05-021-0/+2
| | | | | | | | | | | | | A callable object passed as a constraint for a route may access the request parameters as part of its check. This causes the combined parameters hash to be cached in the environment hash. If the constraint fails then any subsequent access of the request parameters will be against that stale hash. To fix this we delete the cache after every call to `matches?`. This may have a negative performance impact if the contraint wraps a large number of routes as the parameters hash is built by merging GET, POST and path parameters. Fixes #2510.
* Shadowing variable warning removedArun Agrawal2012-04-261-3/+3
|
* Allow loading external route files from the routerJose and Yehuda2012-04-251-0/+16
| | | | | | | | | This feature enables the ability to load an external routes file from the router via: draw :filename External routes files go in +config/routes+. This feature works in both engines and applications.
* Remove default match without specified methodJose and Yehuda2012-04-241-2/+12
| | | | | | | | | | | | | | | | In the current router DSL, using the +match+ DSL method will match all verbs for the path to the specified endpoint. In the vast majority of cases, people are currently using +match+ when they actually mean +get+. This introduces security implications. This commit disallows calling +match+ without an HTTP verb constraint by default. To explicitly match all verbs, this commit also adds a :via => :all option to +match+. Closes #5964