Commit Graph

113 Commits

Author SHA1 Message Date
Joshua Peek
d5539958a8 Wrap CGIResponse, LegacyRouteSet, Route, RouteSet and RouteLoading tests inside mocha block. 2008-06-07 23:42:05 -05:00
Joshua Peek
c08547d226 Namespace Inflector, Dependencies, OrderedOptions, and TimeZone under ActiveSupport [#238 state:resolved] 2008-06-03 13:32:53 -05:00
Sven Fuchs
345f030c5b Ensure routing generator works with non-string keys. [#172 state:resolved]
Make sure that (with recent correction to globbed parameter escaping) non-string
values can still be passed route generation helpers for globbed route segments.

For example, foo_path([1, 2, 3]) should still work for a route like map.foo "*globbed"
by implicitely calling to_s on the Fixnums.

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-05-16 17:36:09 +01:00
Chris Roos
6776edccf6 Escape globbed parameters in routes correctly.
:controller => 'glob', :action=> 'show', :additional => ['foo/bar', 'baz']

Should generate /glob/show/foo%2Fbar/baz not  /glob/show/foo/bar/baz
2008-05-10 14:55:41 +12:00
David Heinemeier Hansson
926f4648f0 Made the location of the routes file configurable with config.routes_configuration_file (Scott Fleckenstein) [#88 state:resolved] 2008-05-01 17:26:31 -05:00
David Heinemeier Hansson
db3a60eb92 Added support for regexp flags like ignoring case in the :requirements part of routes declarations (closes #11421) [NeilW]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9115 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-03-28 20:01:21 +00:00
Jeremy Kemper
f2840f508d Fix an edge case with extra periods in Routing.normalize_paths. Closes #11337 [cavalle, veejar]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9069 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-03-21 22:44:04 +00:00
Michael Koziarski
6e165b8940 Make it simpler to make the root route an alias for another route. Closes #10818 [bscofield]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8738 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-26 08:41:19 +00:00
Jeremy Kemper
630c643f5b Add timing test for large restful route recognition. References #10835 [oleganza]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8673 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-19 05:24:44 +00:00
Jeremy Kemper
07fcac508a Ruby 1.9 compat: don't rely on Array#to_s to flatten and join as string
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8590 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-07 08:12:34 +00:00
Jeremy Kemper
9d755f1983 require abstract_unit directly since test is in load path
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8564 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-05 13:32:06 +00:00
Jeremy Kemper
f85089aabb Fixes for standalone tests
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8406 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-15 02:29:04 +00:00
David Heinemeier Hansson
2af36bbbd4 Fix typos (closes #10378)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8301 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 18:54:41 +00:00
Michael Koziarski
6a611e1e95 Make sure the optimisation code for routes doesn't get used if :host, :anchor or :port are provided in the hash arguments. [pager, Koz] Closes #10292
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8227 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-28 04:11:37 +00:00
David Heinemeier Hansson
5e94f053cb Fixed to_s bug with namespace routes (closes #10283) [johnb]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8216 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-26 22:41:28 +00:00
David Heinemeier Hansson
9e76b59c85 Fixed that named routes living under resources shouldn't have double slashes (closes #10198) [isaacfeliu]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8206 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-25 22:24:23 +00:00
Michael Koziarski
0c12d6c6dc Ensure that the routing optimisation code isn't used when additional arguments are passed to the named route. Closes #10209 [bscofield, Koz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8169 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-20 21:25:25 +00:00
Jeremy Kemper
ae8179f05c Expand Routes::DynamicSegment test coverage. Closes #7122 [Kevin Clark]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7898 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-15 04:27:31 +00:00
Michael Koziarski
bd03bf9f5e Make sure that custom inflections are picked up by map.resources by triggering a routing reload when new inflections are defined. Closes #9815 [mislav, kampers]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7849 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-13 03:28:35 +00:00
Rick Olson
904df818d6 Move ActionController::Routing.optimise_named_routes to ActionController::Base.optimise_named_routes. Now you can set it in the config.
ActionController::Routing::DynamicSegment#interpolation_chunk should call #to_s on all values before calling URI.escape.  [Rick]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7724 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-03 05:47:41 +00:00
Michael Koziarski
9660360d6b Re-enable Routing optimisation code for _url methods, add defined?(request) to the guard conditions
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7673 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-28 20:57:39 +00:00
David Heinemeier Hansson
e3b49c052b Fixed spelling errors (closes #9706) [tarmo/rmm5t]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7666 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-28 14:18:47 +00:00
Jeremy Kemper
cb5b8a7f05 Optimized named routes respect AbstractRequest.relative_url_root. Closes #9612.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7605 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-23 22:52:57 +00:00
Jeremy Kemper
6580b3ab00 Remove , and ; (comma and semicolon) from routing separators again. References #8558.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7599 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-23 21:58:02 +00:00
Michael Koziarski
7573791284 Disable the routing optimisation code when dealing with foo_url helpers. Add test to actionmailer to expose the problem they introduced. References #9450 [Koz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7572 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-22 19:20:06 +00:00
Michael Koziarski
7cb26b5d2d Disable optimisation code for UrlWriter as request.host doesn't make sense there.
Don't try to use the .to_query method when the route has no dynamic segments.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7501 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-17 09:30:18 +00:00
Jeremy Kemper
148202d401 Fixed optimized route segment escaping. Closes #9562.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7487 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-15 22:10:20 +00:00
Jeremy Kemper
494d2c631b root_path returns '/' not ''. Closes #9563.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7482 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-15 20:38:39 +00:00
Michael Koziarski
80ff0b9f1c Optimise named route generation when using positional arguments. Closes #9450 [Koz]
This change delivers significant performance benefits for the most
  common usage scenarios for modern rails applications by avoiding the
  costly trip through url_for.  Initial benchmarks indicate this is
  between 6 and 20 times as fast.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7421 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-09 00:18:55 +00:00
Tobias Lütke
68d685056a Remove deprecated named routes [pixeltrix]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7415 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-06 14:28:32 +00:00
Michael Koziarski
a75d273ece Allow additional parameters to be passed to named route helpers when using positional arguments. Closes #8930 [ian.w.white@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7411 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-05 23:37:17 +00:00
Jeremy Kemper
557e19346a Prefix nested resource named routes with their action name, e.g. new_group_user_path(@group) instead of group_new_user_path(@group). The old nested action named route is deprecated in Rails 1.2.4. Closes #8558.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7138 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-27 08:38:55 +00:00
Jeremy Kemper
160af194e4 Routing: improve static segment test coverage. #7117 [Kevin Clark]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6979 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-09 04:39:01 +00:00
Jeremy Kemper
8139de2812 Routing: drop semicolon and comma as route separators.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6888 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-29 06:40:33 +00:00
Jeremy Kemper
dcaa074abf Routing: respond with 405 Method Not Allowed status when the route path matches but the HTTP method does not. Closes #6953.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6862 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-26 20:07:34 +00:00
Tobias Lütke
1008535905 Allow routes to be declared off namespaces
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6783 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-19 16:26:44 +00:00
Jeremy Kemper
50253edec9 Rationalize route path escaping according to RFC 2396 section 3.3. Closes #7544, #8307.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6730 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-14 11:14:30 +00:00
Nicholas Seckar
2ca6f57f85 Add broken test
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6724 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-12 04:46:17 +00:00
Nicholas Seckar
a5fe13e871 Add ActionController::Routing::Helpers, a module to contain common URL helpers such as polymorphic_url.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6722 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-12 04:18:46 +00:00
Marcel Molina
b7565075c3 More documentations for typos in routes. Closes #8228 [pam]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6673 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-06 04:26:49 +00:00
Jamis Buck
777deb9d15 Make sure the expiry hash is built by comparing the to_param-ized values of each hash
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6465 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-26 19:02:19 +00:00
Jeremy Kemper
e17df19b86 Allow array and hash query parameters. Array route parameters are converted/to/a/path as before. References #6765, #7462. Closes #7047.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6343 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-06 07:47:23 +00:00
David Heinemeier Hansson
b203b9b55b Fixed broken test
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6231 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-25 20:11:18 +00:00
Jeremy Kemper
de0a0d700e Routing: better support for escaped values in route segments. Closes #7544.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6185 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-21 10:05:07 +00:00
Rick Olson
7a49cb058f fix form_for example in ActionController::Resources documentation. Closes #7362 [gnarg], Added enhanced docs to routing assertions. Closes #7359 [Rob Sanheim], improve error message for Routing for named routes. Closes #7346 [Rob Sanheim]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6113 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-04 19:07:08 +00:00
Nicholas Seckar
2cc9c8135c Allow Routes to generate all urls for a set of options by specifying :generate_all => true. References #1739.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6082 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-28 17:29:51 +00:00
Jeremy Kemper
0eacdcf9a3 Use a consistent load path to avoid double requires. Fix some scattered Ruby warnings.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6057 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-28 07:16:55 +00:00
Rick Olson
d2205ea5e9 Improve Test Coverage for ActionController::Routing::Route#matches_controller_and_action? (Heckle++) #7115 [Kevin Clark]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5976 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-17 06:49:43 +00:00
Jeremy Kemper
f9f84d9f6d Routing uses URI escaping for path components and CGI escaping for query parameters.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5803 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-28 21:04:44 +00:00
Nicholas Seckar
d1a2449220 Fix a bug in Routing where a parameter taken from the path of the current request could not be used as a query parameter for the next. Closes #6752.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5709 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-09 04:42:32 +00:00