aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/mapper.rb
Commit message (Collapse)AuthorAgeFilesLines
* Remove warning "too many arguments for format string" when interpolating ↵Emilio Tagua2010-09-271-1/+1
| | | | with empty hash.
* Initialize @as before plural method is called.Emilio Tagua2010-09-271-0/+1
|
* Remove warning "URI.unescape is obsolete" from actionpack.Emilio Tagua2010-09-271-9/+9
|
* Raise ArgumentError instead of normalizing controller name when there is a ↵Andrew White2010-09-181-1/+5
| | | | leading slash [#5651 state:resolved]
* Remove leading slash from controller [#5651 state:resolved]Andrew White2010-09-181-1/+1
|
* Remove a few tests from old router that do not make sense with the new one.José Valim2010-09-051-21/+3
|
* Ported missing functionality from Rails 2.3.x, raise error on wrong regexps ↵Piotr Sarnacki2010-09-051-0/+9
| | | | in :constraints in routes
* raise error on invalid HTTP methods or :head passed with :via in routesPiotr Sarnacki2010-09-051-0/+9
|
* Implemented resources :foos, :except => :all optionPiotr Sarnacki2010-09-051-2/+11
|
* Removed deprecated RouteSet API, still many tests failPiotr Sarnacki2010-09-051-6/+1
|
* Implemented RouteSet#default_scope, which allows to set the scope for the ↵Piotr Sarnacki2010-09-031-0/+6
| | | | entire routes object
* Add Rails::Railtie.railtie_name method to allow setting custom name for railtiePiotr Sarnacki2010-09-031-2/+7
|
* Add mounted_helpers to routesPiotr Sarnacki2010-09-031-2/+3
| | | | | | | | | | | | | | | | mounted_helpers are a bit similar to url_helpers. They're automatically included in controllers for Rails.application and each of mounted Engines. Mounted helper allows to call url_for and named helpers for given application. Given Blog::Engine mounted as blog_engine, there are 2 helpers defined: app and blog_engine. You can call routes for app and engine using those helpers: app.root_url app.url_for(:controller => "foo") blog_engine.posts_path blog_engine.url_for(@post)
* Routes refactoring:Piotr Sarnacki2010-09-031-2/+1
| | | | | | | * added more tests for prefix generation * fixed bug with generating host for both prefix and url * refactored url_for method * organized tests for prefix generation
* Allow to generate Application routes inside EnginePiotr Sarnacki2010-09-031-1/+1
| | | | | | This requires knowledge about original SCRIPT_NAME and the parent router. It should be pass through the env as ORIGIAL_SCRIPT_NAME and action_dispatch.parent_routes
* Use env['action_dispatch.routes'] to determine if we should generate prefix ↵Piotr Sarnacki2010-09-031-0/+27
| | | | | | | | | | or not. This technique is here to allow using routes from Engine in Application and vice versa. When using Engine routes inside Application it should generate prefix based on mount point. When using Engine routes inside Engine it should use env['SCRIPT_NAME']. In any other case it should generate prefix as env should not be even available.
* Move implicit nested call before options handling so that nested constraints ↵Andrew White2010-09-011-9/+7
| | | | | | work [#5513 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Expanded routing documentation with current best practicesJoost Baaij2010-08-291-0/+169
|
* Use nested scope for routes defined at the :resources scope level (as in ↵Andrew White2010-08-241-5/+6
| | | | | | Rails 2.3) Signed-off-by: José Valim <jose.valim@gmail.com>
* Allow format to be skipped. This is used internally by mount.José Valim2010-08-241-2/+5
|
* Finally fix the bug where symbols and strings were not having the same ↵José Valim2010-08-241-67/+46
| | | | | | | behavior in the router. If you were using symbols before for methods like match/get/post/put/delete, it is likely that this commit will break your routes. Everything should behave the same if you are using strings, if not, please open up a ticket.
* Ensure shortcuts inside resources also generates helpers.José Valim2010-08-241-48/+39
|
* Fix how routes inside namespaces are generated.José Valim2010-08-241-1/+1
|
* Allow actions which start with A-Za-z_ onlySantiago Pastorino2010-08-241-1/+1
|
* Ensure prefix in routes are generated properly.José Valim2010-08-241-13/+10
|
* Fix a bug where symbols and strings were not behaving the same in the ↵José Valim2010-08-241-9/+4
| | | | router. [#5431 state:resolved]
* When custom resource actions are specified using strings add the default ↵Andrew White2010-08-241-2/+6
| | | | | | | | name and action if the string is a valid ruby method name. [#5431 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Cache the symbolized path parameters using a instance variable in the ↵Andrew White2010-08-221-1/+6
| | | | | | | | | | | request object rather than the environment hash. This it to prevent stale parameters in later routing constraints/redirects as only the normal path parameters are set by Rack::Mount. Also if a constraint proc arity is more than one, pass the symbolized path parameters as the first argument to match redirect proc args and provide easier access. [#5157 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Fix hash modification during iteration in Mapper [#5420]Nick Sieger2010-08-201-1/+1
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Don't add the standard https port when using redirect in routes.rb and ↵Andrew White2010-08-201-1/+1
| | | | | | | | ensure that request.scheme returns https when using a reverse proxy. [#5408 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Allow symbols for :path resource(s) option [#5306 state:resolved]Andrew White2010-08-201-2/+2
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Move regexps in options hash to :constraints hash so that they are pushed ↵Andrew White2010-08-191-0/+4
| | | | | | into the scope [#5208 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Move edit route before show route so that it will have precedence if the :id ↵Andrew White2010-08-191-2/+2
| | | | | | parameter allows slashes [#5409 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Don't pluralize resource methods [#4704 state:resolved]Javier Martín2010-08-181-14/+14
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Allow member actions (get, etc) to accept strings, with testAndre Arko2010-08-171-0/+1
|
* adds URL to the body generated by the redirect macro in the routes mapper as ↵Xavier Noria2010-08-091-1/+4
| | | | per the RFC, extracts common test pattern into a test macro, adds a test to cover the :status option
* Fixes a regression caused by having mapping options controller and action as ↵Santiago Pastorino2010-07-121-1/+4
| | | | | | blank Signed-off-by: José Valim <jose.valim@gmail.com>
* Routes should respect namespace even if action is a regexp and just ↵José Valim2010-07-121-34/+29
| | | | controller is given to to.
* When a dynamic :controller segment is present in the path add a Regexp ↵Andrew White2010-07-071-6/+19
| | | | | | | | | | | constraint that allow matching on multiple path segments. Using a namespace block isn't compatible with dynamic routes so we raise an ArgumentError if we detect a :module present in the scope. [#5052 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Refactor handling of :only and :except options. The rules are:Andrew White2010-07-061-26/+46
| | | | | | | | | | | 1. Don't inherit when specified as an option on a resource 2. Don't push into scope when specified as an option on a resource 2. Resources pull in :only or :except options from scope 3. Either :only or :except in nested scope overwrites parent scope [#5048 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Recognize should also work with route is wrapped in a constraint.José Valim2010-07-061-0/+2
|
* Refactor resource options and scoping. Resource classes are now only ↵Andrew White2010-07-041-99/+64
| | | | | | responsible for controlling how they are named. All other options passed to resources are pushed out to the scope. Signed-off-by: José Valim <jose.valim@gmail.com>
* Fixes for "router" and "routes" terminologyWincent Colaiuta2010-07-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit f7ba614c2db improved the internal consistency of the different means of accessing routes, but it introduced some problems at the level of code comments and user-visible strings. This commit applies fixes on three levels: Firstly, we remove or replace grammatically invalid constructs such as "a routes" or "a particular routes". Secondly, we make sure that we always use "the router DSL" or "the router syntax", because this has always been the official terminology. Finally, we make sure that we only use "routes" when referring to the application-specific set of routes that are defined in the "config/routes.rb" file, we use "router" when referring on a more abstract level to "the code in Rails used to handle routing", and we use "routing" when we need an adjective to apply to nouns such as "url_helpers. Again this is consistent with historical practice and other places in the documentation. Note that this is not a sweep over the entire codebase to ensure consistent usage of language; it is just a revision of the changes introduced in commit f7ba614c2db. Signed-off-by: Wincent Colaiuta <win@wincent.com> Signed-off-by: José Valim <jose.valim@gmail.com>
* Fix routes with :controller segment when namespaced [#5034 state:resolved]José Valim2010-07-021-1/+1
|
* Unify routes naming by renaming router to routesPiotr Sarnacki2010-07-021-1/+1
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* A couple enhancements to the router:José Valim2010-06-301-27/+48
| | | | | | | | * Allow to use the get :symbol shortcut outside resources scopes as well; * Fix a bug where :action was not being picked from given options; * Giving :as option inside a resource now changes just the relative name instead of the full name;
* Clean up the logic to specify the name and path for action a bit.José Valim2010-06-301-87/+51
|
* Merge :constraints from scope into resource options [#2694 state:resolved]Andrew White2010-06-281-4/+6
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Support optional static segements as well [#4832 state:resolved]Andrew White2010-06-261-1/+1
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Fixed normalize_path in Routing::Mapper to handle optional prefix segments ↵Paul Barry2010-06-261-1/+1
| | | | | | with static and dynamic parts Signed-off-by: José Valim <jose.valim@gmail.com>