aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/mapper.rb
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Add missing requires in routesBogdan Gusiev2012-04-231-0/+1
|
* Updated/changed useless tr/gsubsJurriaan Pruis2012-04-031-2/+2
|
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-03-271-0/+19
|\
| * add missing do [ci skip]Vijay Dev2012-03-271-1/+1
| |
| * added shallow_prefix option description in documantationLukasz Sarnacki2012-03-271-0/+19
| | | | | | | | It is in response for confusion in issue #5301
* | Allow a defining custom member field on resourcesJamie Macey2012-03-251-4/+5
|/ | | | | | | | | | By default, resources routes are created with :resource/:id. A model defining to_param can make prettier urls by using something more readable than an integer ID, but since the route picks it up as :id you wind up with awkward User.find_by_username(params[:id]) calls. By overriding the key to be used in @request.params you can be more obvious in your intent.
* Add missing requireSantiago Pastorino2012-03-171-0/+1
|
* Remove unused requireSantiago Pastorino2012-03-171-1/+0
|
* Route root helper shortcutBrian Cardarella2012-03-031-0/+5
| | | | Allow the root route helper to accept just a string
* Optimize path helpers.José Valim2012-03-021-1/+5
|
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-02-251-1/+1
|\ | | | | | | | | Conflicts: actionmailer/CHANGELOG.md
| * Fix typo in match :to docsJustin Woodbridge2012-02-231-1/+1
| |
* | consistently mention first patch, then putXavier Noria2012-02-241-7/+7
| | | | | | | | | | | | There was a mix, sometimes patch first, sometimes put first. Use always patch first, since this is going to be the primary verb for updates.
* | uses PATCH for the forms of persisted records, and routes PATCH and PUT to ↵Xavier Noria2012-02-241-9/+8
| | | | | | | | the update action of resources
* | Fix routes inspection orderRafael Mendonça França2012-02-221-2/+2
| |
* | Add config.default_method_for_update to support PATCHDavid Lee2012-02-221-54/+71
|/ | | | | | | | | | | | | | | | PATCH is the correct HTML verb to map to the #update action. The semantics for PATCH allows for partial updates, whereas PUT requires a complete replacement. Changes: * adds config.default_method_for_update you can set to :patch * optionally use PATCH instead of PUT in resource routes and forms * adds the #patch verb to routes to detect PATCH requests * adds #patch? to Request * changes documentation and comments to indicate support for PATCH This change maintains complete backwards compatibility by keeping :put as the default for config.default_method_for_update.
* Fix match docsRafael Mendonça França2012-02-071-1/+1
|
* Note the ways #match may be calledJeremy Kemper2012-02-051-0/+3
|