aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing
Commit message (Collapse)AuthorAgeFilesLines
...
* 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>
* Support routing constraints in functional testsAndrew White2010-08-201-2/+2
| | | | | | | | | | Extend assert_recognizes and assert_generates to support passing full urls as the path argument. This allows testing of routing constraints such as subdomain and host within functional tests. [#5005 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.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 missing requires for Object#tryXavier Noria2010-08-091-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
* Avoid potentially expensive inspect call in router. [#4491 state:resolved]Samuel Lebeau2010-08-031-3/+6
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* edit pass to apply API guideline wrt the use of "# =>" in example codeXavier Noria2010-07-301-1/+1
|
* Change returning with tapSantiago Pastorino2010-07-251-1/+1
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* options could be of any kind of Hash (Hash, HashWithIndifferentAccess or ↵Santiago Pastorino2010-07-212-2/+2
| | | | OrderedHash) this way we keep the properties of the options passed as an argument
* Fixed a globbed route issue where slashes were being escaped, causing ↵Brian Rose2010-07-211-1/+2
| | | | | | assert_routing to fail. [#5135 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Moved a few methods from RecordIdentifier to ActiveModel::NamingPiotr Sarnacki2010-07-211-3/+3
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Moved PolymorphicRoutes to ActionDispatch::RoutingPiotr Sarnacki2010-07-202-0/+187
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Bump up to rack-mount 0.6.9 and rack-mount-0.6.6.pre removed from ↵Santiago Pastorino2010-07-151-3/+1
| | | | action_dispatch vendor
* 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-072-10/+21
| | | | | | | | | | | 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-062-0/+4
|
* RouteSet should also handle anonymous classes.José Valim2010-07-051-2/+2
|
* Define a convention for descendants and subclasses.José Valim2010-07-051-2/+2
| | | | | | The former should be symmetric with ancestors and include all children. However, it should not include self since ancestors + descendants should not have duplicated. The latter is symmetric to superclass in the sense it only includes direct children. By adopting a convention, we expect to have less conflict with other frameworks, as Datamapper. For this moment, to ensure ActiveModel::Validations can be used with Datamapper, we should always call ActiveSupport::DescendantsTracker.descendants(self) internally instead of self.descendants avoiding conflicts.
* 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-033-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Refactor recall parameter normalization [#5021 state:resolved]Andrew White2010-07-031-16/+6
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Fix routes with :controller segment when namespaced [#5034 state:resolved]José Valim2010-07-022-18/+34
|
* Unify routes naming by renaming router to routesPiotr Sarnacki2010-07-024-7/+7
| | | | 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
|
* Tidy up valid conditions in router a bit.José Valim2010-06-281-2/+4
|
* Add :controller and :action to the list of valid conditionsAndrew White2010-06-281-0/+1
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* 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>
* Remove invalid conditions from route [#4989 state:resolved]Andrew White2010-06-282-4/+14
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Deprecate the old router DSL. Since it is still used intensively across ↵José Valim2010-06-281-0/+2
| | | | ActionPack test suite, patches that translates Rails internal tests to the new router DSL are welcome (note though that a few tests shouldn't be translated since they are testing exactly the old mapper API, like the ones in actionpack/test/controller/resource_test.rb and actionpack/test/controller/routing_test.rb)
* Vendor unreleased rack-mount 0.6.6.pre dependencyJeremy Kemper2010-06-271-1/+3
|
* Normalize recall params when the route is not a standard route otherwise ↵Andrew White2010-06-271-3/+26
| | | | | | :controller and :action may appear in the generated url [#4326 state:resolved] 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>
* Don't force pluralization of controller name when defining a resource [#4980 ↵Andrew White2010-06-261-1/+9
| | | | | | state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* URL fragments should not have safe characters escaped. Ref: Appendix A, ↵Andrew White2010-06-251-1/+1
| | | | | | | | http://tools.ietf.org/rfc/rfc3986.txt [#4762 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fix namespaced redirects [#4389 state:resolved]Andrew White2010-06-241-1/+1
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Add the :path option to match routes when given as symbols. This is ↵Carlos Antonio da Silva2010-06-231-9/+8
| | | | | | | | | | specially useful in http helpers for generating routes in scenarios like: resources :users, :path => 'usuarios' do get :search, :on => :collection, :path => 'pesquisar' end Signed-off-by: José Valim <jose.valim@gmail.com>
* Provive resources_path_names helpers in the router.José Valim2010-06-231-0/+4
|