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
David Heinemeier Hansson
2794f4164f
Dropped the idea of automatically routing :format for the vanilla routes -- that will be a treat for map.resources. Deprecated the name route root as it'll be used as a shortcut for map.connect '' in Rails 2.0 (Rails 1.2). Added map.root as an alias for map.connect '' (Rails 2.0)
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5671 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-04 00:12:00 +00:00
Nicholas Seckar
d1529a71d1
Update Routing to complain when :controller is not specified by a route. Closes #6669 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5607 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-22 16:31:00 +00:00
Jeremy Kemper
f8486e8f10
silence const_set warning
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5503 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-13 01:17:10 +00:00
Rick Olson
cfb7dea783
clean up failing routing tests from missing :only_path option [Rick]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5337 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-22 23:48:52 +00:00
Nicholas Seckar
03b383853d
Fix routing to correctly determine when generation fails. Closes #6300 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5314 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-16 19:52:21 +00:00
Jamis Buck
39963b4b9d
remove an obsolete #dup call. avoid double negatives, to make the code easier to understand and explain
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5304 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-15 03:11:08 +00:00
Nicholas Seckar
bc85e6ac4c
Rename test assertion to prevent shadowing. Closes #6306 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5252 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-09 01:20:36 +00:00
Nicholas Seckar
8d809e724a
Clear the cache of possible controllers whenever Routes are reloaded.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5169 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-09-23 17:25:06 +00:00
Nicholas Seckar
4ae3db8366
Fix routing to respect user provided requirements and defaults when assigning default routing options (such as :action => 'index'). Closes #5950 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5151 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-09-20 17:45:03 +00:00
David Heinemeier Hansson
40762a4873
Fixed default routing NoMethodError downcase for nil when default controller provided ( closes #5400 ) [kajism@yahoo.com]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4998 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-09-04 20:09:15 +00:00
Rick Olson
2b45e2d370
Add routing tests to assert that RoutingError is raised when conditions aren't met. Closes #6016 [Nathan Witmer]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4907 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-09-02 20:41:40 +00:00