Commit Graph

108 Commits

Author SHA1 Message Date
José Valim
772a0226fd Add a test which ensures slugs in :id work. 2010-03-31 00:19:40 +02:00
Rizwan Reza
cf6734fdf9 Add more tests and docs to uncountable routes. [#3930 state:resolved] 2010-03-28 18:34:48 -07:00
Jan De Poorter
72074aac33 Add _index to named collection routes for uncountable resources (e.g. Sheep)
Signed-off-by: Rizwan Reza <rizwanreza@gmail.com>
2010-03-28 18:34:48 -07:00
Andrew White
e1a70faea6 Add constraints to resources in new routing DSL
Signed-off-by: Rizwan Reza <rizwanreza@gmail.com>
2010-03-28 23:31:13 +04:30
Andrew White
39c35ff04b Fix named routes for member actions of singleton resources [#4266 state:resolved]
Signed-off-by: wycats <wycats@gmail.com>
2010-03-27 00:49:47 -07:00
Andrew White
3d746fcdb5 Add parameter defaults support to new routing DSL [#4265 state:resolved]
Signed-off-by: wycats <wycats@gmail.com>
2010-03-27 00:21:10 -07:00
José Valim
b2c2b0ce45 Rails router automatically calculated for you the controller and named routes in the following scenarios:
match "home/about"                 #=> maps to home#about with named route home_about_path
  match "about"                      #=> does not work because it cannot guess the controller
  match "about" => "home#about"      #=> maps to home#about with named route home_about_path
  match "home/about", :as => "about" #=> maps to home#about with named route about_path
2010-03-26 15:51:51 +01:00
José Valim
4998e097cc Make router shortcuts more polite to URLs starting with a leading slash. 2010-03-22 21:07:37 +01:00
Joshua Peek
13a783672a Install url helpers on module instance so they can be accessed
globally
2010-03-17 16:05:29 -05:00
Joshua Peek
1cc2a61ea6 Allow default_url_options to be set on route set 2010-03-09 21:20:13 -06:00
Jan De Poorter
dfc7ff6429 Make sure nested singular resources get the correct name
[#3911 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-03-07 14:36:26 -08:00
Carlhuda
98f77e0827 Rename named_url_helpers to url_helpers and url_helpers to url_for 2010-02-26 15:04:50 -08:00
Carlhuda
226dfc2681 WIP: Remove the global router 2010-02-25 17:53:00 -08:00
Martin Schürrer
6bc24d40d5 Use ActionDispatch::Routing everywhere 2010-02-21 13:43:51 -08:00
José Valim
19787e6259 Should allow symbols in :only and :except in routes. 2010-02-16 22:39:08 +01:00
José Valim
22c0390085 Add a test which ensures namespaced roots. 2010-02-06 11:52:28 +01:00
José Valim
8974dac92e Ensure root routes inside optional scopes works as expected. 2010-01-26 00:55:26 +01:00
Joshua Peek
e9a1dbe79a Allow custom controller for resource(s) [#3703 state:resolved] 2010-01-16 15:16:22 -06:00
José Valim
5a5760828b Add tests for simple match with namespace. 2010-01-15 23:36:03 +01:00
Joshua Peek
b2578a148c Fix singleton resource named routes 2010-01-15 16:31:00 -06:00
Joshua Peek
576b8dda52 Cleanup internal resource macro to use method helper shorthand 2010-01-15 16:13:01 -06:00
Joshua Peek
184ef28f55 Routing method shorthand shouldn't clobber :to options 2010-01-15 14:55:13 -06:00
Joshua Peek
be968ecd8b Respect resources_path_names and :path_names options in new dsl 2010-01-13 20:26:01 -06:00
José Valim
35933822de Ensure optional path scopes are properly handled. 2010-01-14 01:31:17 +01:00
Joshua Peek
d01716731b Add router support for resources :only and :except actions 2010-01-13 17:23:14 -06:00
Joshua Peek
5d787590f2 Cool this routing test passes now 2010-01-13 16:42:47 -06:00
Joshua Peek
bf9b81e2cb Pass :as to resources to change the resource name 2010-01-13 12:18:06 -06:00
Joshua Peek
521ef3c40f Passing in a crud action overloads the default action instead of creating a
new member action.
2010-01-13 11:45:27 -06:00
José Valim
8d72ba51ba Ensure nested namespaces work as expected. 2010-01-10 18:42:45 +01:00
Joao Carlos
36969c6ecd Fixes namespaced routes [#3673 status:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-01-10 12:49:31 +01:00
José Valim
0d5ce7c525 namespace in routes changes both the path and name prefix. 2010-01-06 09:51:46 +01:00
José Valim
e55d70a380 redirect in routes takes port into account [#3653 status:resolved] 2010-01-05 23:40:56 +01:00
Joshua Peek
b3900a29eb All router redirect helper to accept a full URI [#3653 state:resolved] 2010-01-05 12:00:38 -06:00
David Heinemeier Hansson
95762cbbb3 Added shorthand for match 'products/overview' that expands to match 'products/overview', :to => 'products#overview', :as => 'products_overview' 2009-12-27 14:13:03 -08:00
David Heinemeier Hansson
38af368360 Merge 2009-12-24 15:24:57 -08:00
David Heinemeier Hansson
2b7256a42e Extract Mapping class from monster match method 2009-12-24 15:23:39 -08:00
Sam Ruby
aa3565f3a6 Allow named_routes to be used with root, and with new DSL short-form.
The real use case it to make all of the following act the same:

  root 'store#index', :as => 'store'
  match '/' => 'store#index', :as => 'store'
  match '/', :to => 'store#index', :as => 'store'

The test case provided deviates from this in order to demonstrate all three
forms in a single set of test routes.

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-12-23 20:55:21 -08:00
Jeremy Kemper
4d3602a8c4 Routing: fix that route shorthand shouldn't ignore other options. Raise if :as option is given to root method since its name is always 'root' 2009-12-23 17:42:30 -08:00
David Heinemeier Hansson
8e48a5ef0c Add test for root 2009-12-21 21:49:36 -08:00
David Heinemeier Hansson
3ff9e9ee14 Its now possible to use match 'stuff' => 'what#stuff' instead of using the :to for simple routes 2009-12-20 20:37:36 -08:00
Yehuda Katz
e48b4c2dd0 :to => redirect() can take a String using 1.9-style interpolation or proc that takes the path parameters as a Hash 2009-12-20 14:07:32 -08:00
Joshua Peek
2297eaed5b "new" and "edit" name routes always need to be prepend to the
named_route [#3561 state:resolved]
2009-12-11 12:46:50 -06:00
Joshua Peek
ec5434c3c2 Check block arity passed to routes draw so you don't need to use
|map|
2009-12-09 20:46:32 -06:00
Joshua Peek
511cef296b Tack format onto resource routes 2009-12-08 17:19:49 -06:00
Joshua Peek
ac711043ec Fix ambiguous access_token scoping example 2009-12-08 16:15:25 -06:00
Joshua Peek
3d91d7f0a2 Routes added under resource collection should be prefixed with
resource collection name
2009-12-08 15:31:56 -06:00
Joshua Peek
1fc58a889d Fixed named prefix scope in resource member and collection actions 2009-12-07 20:57:01 -06:00
Joshua Peek
5835447b6f named_prefix doesn't join with "_" 2009-12-07 19:31:29 -06:00
Joshua Peek
e8489b43e2 Allow name_prefix to be pass into scope 2009-12-07 19:24:33 -06:00
Joshua Peek
40ad54e381 Allow scope to take :path and :controller options 2009-12-07 18:28:02 -06:00
Joshua Peek
075f50d62c Fix some nested resource generation tests 2009-11-29 18:17:14 -06:00
Joshua Peek
5df26dd7a9 Add basic nested named route support to new routing dsl. Also add a
bunch of pending tests.
2009-11-19 09:04:53 -08:00
Jeremy Kemper
52e2bbd5c0 Ruby 1.9: work around constant resolution behavior change :( 2009-11-04 14:51:54 -08:00
Joshua Peek
f950d0b4af Fix simple resource named routes for new routing dsl 2009-11-03 11:23:22 -06:00
Joshua Peek
07da304ff8 Some more generation tests 2009-10-27 21:02:21 -05:00
Joshua Peek
43e0bc1c9f Extract routing controller stub helper into abstract unit 2009-10-27 21:02:20 -05:00
Joshua Peek
e296ea056e Enable named route tests 2009-10-27 21:02:20 -05:00
Joshua Peek
759f2ccc4c Start migrating AC routing tests into dispatch folder 2009-10-27 21:02:20 -05:00