public
Fork of rails/rails
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/JackDanger/rails.git
Change the resource seperator from ; to / change the generated routes to 
use the new-style named routes.  e.g.  new_group_user_path(@group) instead 
of group_new_user_path(@group). [pixeltrix] Closes #8558


git-svn-id: 
http://svn-commit.rubyonrails.org/rails/branches/1-2-stable@7713 
5ecf4fe2-1ee6-0310-87b1-e25e094e27de
NZKoz (author)
Sun Sep 30 23:44:07 -0700 2007
commit  779db44f74066a4794d0ea83c1f87cb2e3e80cb1
tree    401d83ebc406dbd1f2304a5c53712613fb395ba1
parent  a11dc682a99b1eac547ca5a9bab36f58b7565a38
...
1
2
 
 
 
 
3
4
5
...
1
2
3
4
5
6
7
8
9
0
@@ -1,5 +1,9 @@
0
 *SVN*
0
 
0
+* Change the resource seperator from ; to / change the generated routes to use the new-style named routes. e.g. new_group_user_path(@group) instead of group_new_user_path(@group). [pixeltrix]
0
+
0
+
0
+
0
 * Integration tests: introduce methods for other HTTP methods. #6353 [caboose]
0
 
0
 * Improve performance of action caching. Closes #8231 [skaes]
...
292
293
294
 
 
 
 
295
296
297
...
292
293
294
295
296
297
298
299
300
301
0
@@ -292,6 +292,10 @@ module ActionController #:nodoc:
0
     # Turn on +ignore_missing_templates+ if you want to unit test actions without making the associated templates.
0
     cattr_accessor :ignore_missing_templates
0
 
0
+ # Controls the resource action separator
0
+ @@resource_action_separator = "/"
0
+ cattr_accessor :resource_action_separator
0
+
0
     # Holds the request object that's primarily used to get environment variables through access like
0
     # <tt>request.env["REQUEST_URI"]</tt>.
0
     attr_internal :request
...
2
3
4
5
 
6
7
8
9
10
11
12
 
13
14
15
16
17
18
19
 
20
21
22
23
 
24
25
26
27
 
28
29
30
31
 
32
33
34
35
 
36
37
38
39
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
41
42
43
44
45
46
 
47
48
49
...
52
53
54
 
55
56
57
...
60
61
62
63
 
64
65
66
...
178
179
180
181
182
 
 
183
184
185
 
 
186
187
188
...
192
193
194
195
 
196
197
198
...
204
205
206
207
 
208
209
210
211
 
212
213
214
215
 
216
217
218
219
 
220
221
222
...
235
236
237
238
239
240
 
 
 
 
241
242
243
...
300
301
302
303
 
304
305
306
...
315
316
317
318
 
319
320
321
...
324
325
326
327
328
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
329
330
331
...
335
336
337
 
 
 
 
 
338
339
340
...
351
352
353
354
355
 
 
 
 
 
 
 
 
 
 
 
 
 
 
356
357
358
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
359
360
361
...
365
366
367
368
369
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
370
371
372
...
374
375
376
 
 
 
 
 
377
378
379
...
2
3
4
 
5
6
7
8
9
10
11
 
12
13
14
15
16
17
18
 
19
20
21
22
 
23
24
25
26
 
27
28
29
30
 
31
32
33
34
 
35
36
37
38
 
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
 
66
67
68
69
...
72
73
74
75
76
77
78
...
81
82
83
 
84
85
86
87
...
199
200
201
 
 
202
203
204
 
 
205
206
207
208
209
...
213
214
215
 
216
217
218
219
...
225
226
227
 
228
229
230
231
 
232
233
234
235
 
236
237
238
239
 
240
241
242
243
...
256
257
258
 
 
 
259
260
261
262
263
264
265
...
322
323
324
 
325
326
327
328
...
337
338
339
 
340
341
342
343
...
346
347
348
 
 
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
...
370
371
372
373
374
375
376
377
378
379
380
...
391
392
393
 
 
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
 
 
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
...
431
432
433
 
 
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
...
454
455
456
457
458
459
460
461
462
463
464
0
@@ -2,48 +2,68 @@ module ActionController
0
   module Resources
0
     class Resource #:nodoc:
0
       attr_reader :collection_methods, :member_methods, :new_methods
0
- attr_reader :path_prefix, :name_prefix
0
+ attr_reader :path_prefix, :new_name_prefix
0
       attr_reader :plural, :singular
0
       attr_reader :options
0
 
0
       def initialize(entities, options)
0
         @plural = entities
0
         @singular = options[:singular] || plural.to_s.singularize
0
-
0
+
0
         @options = options
0
 
0
         arrange_actions
0
         add_default_actions
0
         set_prefixes
0
       end
0
-
0
+
0
       def controller
0
         @controller ||= (options[:controller] || plural).to_s
0
       end
0
-
0
+
0
       def path
0
         @path ||= "#{path_prefix}/#{plural}"
0
       end
0
-
0
+
0
       def new_path
0
         @new_path ||= "#{path}/new"
0
       end
0
-
0
+
0
       def member_path
0
         @member_path ||= "#{path}/:id"
0
       end
0
-
0
+
0
       def nesting_path_prefix
0
         @nesting_path_prefix ||= "#{path}/:#{singular}_id"
0
       end
0
-
0
+
0
+ def deprecate_name_prefix?
0
+ @name_prefix.blank? && !@new_name_prefix.blank?
0
+ end
0
+
0
+ def name_prefix
0
+ deprecate_name_prefix? ? @new_name_prefix : @name_prefix
0
+ end
0
+
0
+ def old_name_prefix
0
+ @name_prefix
0
+ end
0
+
0
+ def nesting_name_prefix
0
+ "#{new_name_prefix}#{singular}_"
0
+ end
0
+
0
+ def action_separator
0
+ @action_separator ||= Base.resource_action_separator
0
+ end
0
+
0
       protected
0
         def arrange_actions
0
           @collection_methods = arrange_actions_by_methods(options.delete(:collection))
0
           @member_methods = arrange_actions_by_methods(options.delete(:member))
0
           @new_methods = arrange_actions_by_methods(options.delete(:new))
0
         end
0
-
0
+
0
         def add_default_actions
0
           add_default_action(member_methods, :get, :edit)
0
           add_default_action(new_methods, :get, :new)
0
@@ -52,6 +72,7 @@ module ActionController
0
         def set_prefixes
0
           @path_prefix = options.delete(:path_prefix)
0
           @name_prefix = options.delete(:name_prefix)
0
+ @new_name_prefix = options.delete(:new_name_prefix)
0
         end
0
 
0
         def arrange_actions_by_methods(actions)
0
@@ -60,7 +81,7 @@ module ActionController
0
             flipped_hash
0
           end
0
         end
0
-
0
+
0
         def add_default_action(collection, method, action)
0
           (collection[method] ||= []).unshift(action)
0
         end
0
@@ -178,11 +199,11 @@ module ActionController
0
     #
0
     # The comment resources work the same, but must now include a value for :article_id.
0
     #
0
- # comments_url(@article)
0
- # comment_url(@article, @comment)
0
+ # article_comments_url(@article)
0
+ # article_comment_url(@article, @comment)
0
     #
0
- # comments_url(:article_id => @article)
0
- # comment_url(:article_id => @article, :id => @comment)
0
+ # article_comments_url(:article_id => @article)
0
+ # article_comment_url(:article_id => @article, :id => @comment)
0
     #
0
     # * <tt>:name_prefix</tt> -- define a prefix for all generated routes, usually ending in an underscore.
0
     # Use this if you have named routes that may clash.
0
@@ -192,7 +213,7 @@ module ActionController
0
     #
0
     # * <tt>:collection</tt> -- add named routes for other actions that operate on the collection.
0
     # Takes a hash of <tt>#{action} => #{method}</tt>, where method is <tt>:get</tt>/<tt>:post</tt>/<tt>:put</tt>/<tt>:delete</tt>
0
- # or <tt>:any</tt> if the method does not matter. These routes map to a URL like /messages;rss, with a route of rss_messages_url.
0
+ # or <tt>:any</tt> if the method does not matter. These routes map to a URL like /messages/rss, with a route of rss_messages_url.
0
     # * <tt>:member</tt> -- same as :collection, but for actions that operate on a specific member.
0
     # * <tt>:new</tt> -- same as :collection, but for actions that operate on the new resource action.
0
     #
0
@@ -204,19 +225,19 @@ module ActionController
0
     # # --> GET /thread/7/messages/1
0
     #
0
     # map.resources :messages, :collection => { :rss => :get }
0
- # # --> GET /messages;rss (maps to the #rss action)
0
+ # # --> GET /messages/rss (maps to the #rss action)
0
     # # also adds a named route called "rss_messages"
0
     #
0
     # map.resources :messages, :member => { :mark => :post }
0
- # # --> POST /messages/1;mark (maps to the #mark action)
0
+ # # --> POST /messages/1/mark (maps to the #mark action)
0
     # # also adds a named route called "mark_message"
0
     #
0
     # map.resources :messages, :new => { :preview => :post }
0
- # # --> POST /messages/new;preview (maps to the #preview action)
0
+ # # --> POST /messages/new/preview (maps to the #preview action)
0
     # # also adds a named route called "preview_new_message"
0
     #
0
     # map.resources :messages, :new => { :new => :any, :preview => :post }
0
- # # --> POST /messages/new;preview (maps to the #preview action)
0
+ # # --> POST /messages/new/preview (maps to the #preview action)
0
     # # also adds a named route called "preview_new_message"
0
     # # --> /messages/new can be invoked via any request method
0
     #
0
@@ -235,9 +256,10 @@ module ActionController
0
     # /account profile.
0
     #
0
     # See map.resources for general conventions. These are the main differences:
0
- # - a singular name is given to map.resource. The default controller name is taken from the singular name.
0
- # - To specify a custom plural name, use the :plural option. There is no :singular option
0
- # - No default index, new, or create routes are created for the singleton resource controller.
0
+ # - A singular name is given to map.resource. The default controller name is taken from the singular name.
0
+ # - There is no <tt>:collection</tt> option as there is only the singleton resource.
0
+ # - There is no <tt>:singular</tt> option as the singular name is passed to map.resource.
0
+ # - No default index route is created for the singleton resource controller.
0
     # - When nesting singleton resources, only the singular name is used as the path prefix (example: 'account/messages/1')
0
     #
0
     # Example:
0
@@ -300,7 +322,7 @@ module ActionController
0
           map_member_actions(map, resource)
0
 
0
           if block_given?
0
- with_options(:path_prefix => resource.nesting_path_prefix, &block)
0
+ with_options(:path_prefix => resource.nesting_path_prefix, :new_name_prefix => resource.nesting_name_prefix, &block)
0
           end
0
         end
0
       end
0
@@ -315,7 +337,7 @@ module ActionController
0
           map_member_actions(map, resource)
0
 
0
           if block_given?
0
- with_options(:path_prefix => resource.nesting_path_prefix, &block)
0
+ with_options(:path_prefix => resource.nesting_path_prefix, :new_name_prefix => resource.nesting_name_prefix, &block)
0
           end
0
         end
0
       end
0
@@ -324,8 +346,21 @@ module ActionController
0
         resource.collection_methods.each do |method, actions|
0
           actions.each do |action|
0
             action_options = action_options_for(action, resource, method)
0
- map.named_route("#{resource.name_prefix}#{action}_#{resource.plural}", "#{resource.path};#{action}", action_options)
0
- map.named_route("formatted_#{resource.name_prefix}#{action}_#{resource.plural}", "#{resource.path}.:format;#{action}", action_options)
0
+
0
+ unless resource.old_name_prefix.blank?
0
+ map.deprecated_named_route("#{action}_#{resource.name_prefix}#{resource.plural}", "#{resource.old_name_prefix}#{action}_#{resource.plural}")
0
+ map.deprecated_named_route("formatted_#{action}_#{resource.name_prefix}#{resource.plural}", "formatted_#{resource.old_name_prefix}#{action}_#{resource.plural}")
0
+ end
0
+
0
+ if resource.deprecate_name_prefix?
0
+ map.deprecated_named_route("#{action}_#{resource.name_prefix}#{resource.plural}", "#{action}_#{resource.plural}")
0
+ map.deprecated_named_route("formatted_#{action}_#{resource.name_prefix}#{resource.plural}", "formatted_#{action}_#{resource.plural}")
0
+ end
0
+
0
+ map.named_route("#{action}_#{resource.name_prefix}#{resource.plural}", "#{resource.path}#{resource.action_separator}#{action}", action_options)
0
+ map.connect("#{resource.path};#{action}", action_options)
0
+ map.connect("#{resource.path}.:format;#{action}", action_options)
0
+ map.named_route("formatted_#{action}_#{resource.name_prefix}#{resource.plural}", "#{resource.path}#{resource.action_separator}#{action}.:format", action_options)
0
           end
0
         end
0
       end
0
@@ -335,6 +370,11 @@ module ActionController
0
         map.named_route("#{resource.name_prefix}#{resource.plural}", resource.path, index_action_options)
0
         map.named_route("formatted_#{resource.name_prefix}#{resource.plural}", "#{resource.path}.:format", index_action_options)
0
 
0
+ if resource.deprecate_name_prefix?
0
+ map.deprecated_named_route("#{resource.name_prefix}#{resource.plural}", "#{resource.plural}")
0
+ map.deprecated_named_route("formatted_#{resource.name_prefix}#{resource.plural}", "formatted_#{resource.plural}")
0
+ end
0
+
0
         create_action_options = action_options_for("create", resource)
0
         map.connect(resource.path, create_action_options)
0
         map.connect("#{resource.path}.:format", create_action_options)
0
@@ -351,11 +391,37 @@ module ActionController
0
           actions.each do |action|
0
             action_options = action_options_for(action, resource, method)
0
             if action == :new
0
- map.named_route("#{resource.name_prefix}new_#{resource.singular}", resource.new_path, action_options)
0
- map.named_route("formatted_#{resource.name_prefix}new_#{resource.singular}", "#{resource.new_path}.:format", action_options)
0
+
0
+ unless resource.old_name_prefix.blank?
0
+ map.deprecated_named_route("new_#{resource.name_prefix}#{resource.singular}", "#{resource.old_name_prefix}new_#{resource.singular}")
0
+ map.deprecated_named_route("formatted_new_#{resource.name_prefix}#{resource.singular}", "formatted_#{resource.old_name_prefix}new_#{resource.singular}")
0
+ end
0
+
0
+ if resource.deprecate_name_prefix?
0
+ map.deprecated_named_route("new_#{resource.name_prefix}#{resource.singular}", "new_#{resource.singular}")
0
+ map.deprecated_named_route("formatted_new_#{resource.name_prefix}#{resource.singular}", "formatted_new_#{resource.singular}")
0
+ end
0
+
0
+ map.named_route("new_#{resource.name_prefix}#{resource.singular}", resource.new_path, action_options)
0
+ map.named_route("formatted_new_#{resource.name_prefix}#{resource.singular}", "#{resource.new_path}.:format", action_options)
0
+
0
             else
0
- map.named_route("#{resource.name_prefix}#{action}_new_#{resource.singular}", "#{resource.new_path};#{action}", action_options)
0
- map.named_route("formatted_#{resource.name_prefix}#{action}_new_#{resource.singular}", "#{resource.new_path}.:format;#{action}", action_options)
0
+
0
+ unless resource.old_name_prefix.blank?
0
+ map.deprecated_named_route("#{action}_new_#{resource.name_prefix}#{resource.singular}", "#{resource.old_name_prefix}#{action}_new_#{resource.singular}")
0
+ map.deprecated_named_route("formatted_#{action}_new_#{resource.name_prefix}#{resource.singular}", "formatted_#{resource.old_name_prefix}#{action}_new_#{resource.singular}")
0
+ end
0
+
0
+ if resource.deprecate_name_prefix?
0
+ map.deprecated_named_route("#{action}_new_#{resource.name_prefix}#{resource.singular}", "#{action}_new_#{resource.singular}")
0
+ map.deprecated_named_route("formatted_#{action}_new_#{resource.name_prefix}#{resource.singular}", "formatted_#{action}_new_#{resource.singular}")
0
+ end
0
+
0
+ map.named_route("#{action}_new_#{resource.name_prefix}#{resource.singular}", "#{resource.new_path}#{resource.action_separator}#{action}", action_options)
0
+ map.connect("#{resource.new_path};#{action}", action_options)
0
+ map.connect("#{resource.new_path}.:format;#{action}", action_options)
0
+ map.named_route("formatted_#{action}_new_#{resource.name_prefix}#{resource.singular}", "#{resource.new_path}#{resource.action_separator}#{action}.:format", action_options)
0
+
0
             end
0
           end
0
         end
0
@@ -365,8 +431,22 @@ module ActionController
0
         resource.member_methods.each do |method, actions|
0
           actions.each do |action|
0
             action_options = action_options_for(action, resource, method)
0
- map.named_route("#{resource.name_prefix}#{action}_#{resource.singular}", "#{resource.member_path};#{action}", action_options)
0
- map.named_route("formatted_#{resource.name_prefix}#{action}_#{resource.singular}", "#{resource.member_path}.:format;#{action}",action_options)
0
+
0
+ unless resource.old_name_prefix.blank?
0
+ map.deprecated_named_route("#{action}_#{resource.name_prefix}#{resource.singular}", "#{resource.old_name_prefix}#{action}_#{resource.singular}")
0
+ map.deprecated_named_route("formatted_#{action}_#{resource.name_prefix}#{resource.singular}", "formatted_#{resource.old_name_prefix}#{action}_#{resource.singular}")
0
+ end
0
+
0
+ if resource.deprecate_name_prefix?
0
+ map.deprecated_named_route("#{action}_#{resource.name_prefix}#{resource.singular}", "#{action}_#{resource.singular}")
0
+ map.deprecated_named_route("formatted_#{action}_#{resource.name_prefix}#{resource.singular}", "formatted_#{action}_#{resource.singular}")
0
+ end
0
+
0
+ map.named_route("#{action}_#{resource.name_prefix}#{resource.singular}", "#{resource.member_path}#{resource.action_separator}#{action}", action_options)
0
+ map.connect("#{resource.member_path};#{action}", action_options)
0
+ map.connect("#{resource.member_path}.:format;#{action}", action_options)
0
+ map.named_route("formatted_#{action}_#{resource.name_prefix}#{resource.singular}", "#{resource.member_path}#{resource.action_separator}#{action}.:format", action_options)
0
+
0
           end
0
         end
0
 
0
@@ -374,6 +454,11 @@ module ActionController
0
         map.named_route("#{resource.name_prefix}#{resource.singular}", resource.member_path, show_action_options)
0
         map.named_route("formatted_#{resource.name_prefix}#{resource.singular}", "#{resource.member_path}.:format", show_action_options)
0
 
0
+ if resource.deprecate_name_prefix?
0
+ map.deprecated_named_route("#{resource.name_prefix}#{resource.singular}", "#{resource.singular}")
0
+ map.deprecated_named_route("formatted_#{resource.name_prefix}#{resource.singular}", "formatted_#{resource.singular}")
0
+ end
0
+
0
         update_action_options = action_options_for("update", resource)
0
         map.connect(resource.member_path, update_action_options)
0
         map.connect("#{resource.member_path}.:format", update_action_options)
...
989
990
991
 
 
 
 
992
993
994
...
1019
1020
1021
1022
 
1023
1024
1025
...
1055
1056
1057
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1058
1059
1060
...
1177
1178
1179
 
 
 
 
1180
1181
1182
...
989
990
991
992
993
994
995
996
997
998
...
1023
1024
1025
 
1026
1027
1028
1029
...
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
...
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
0
@@ -989,6 +989,10 @@ module ActionController
0
         def named_route(name, path, options = {})
0
           @set.add_named_route(name, path, options)
0
         end
0
+
0
+ def deprecated_named_route(name, deprecated_name, options = {})
0
+ @set.add_deprecated_named_route(name, deprecated_name)
0
+ end
0
 
0
         # Added deprecation notice for anyone who already added a named route called "root".
0
         # It'll be used as a shortcut for map.connect '' in Rails 2.0.
0
@@ -1019,7 +1023,7 @@ module ActionController
0
         def clear!
0
           @routes = {}
0
           @helpers = []
0
-
0
+
0
           @module ||= Module.new
0
           @module.instance_methods.each do |selector|
0
             @module.send :remove_method, selector
0
@@ -1055,6 +1059,38 @@ module ActionController
0
         def install(destinations = [ActionController::Base, ActionView::Base])
0
           Array(destinations).each { |dest| dest.send :include, @module }
0
         end
0
+
0
+ def define_deprecated_named_route_methods(name, deprecated_name)
0
+
0
+ [:url, :path].each do |kind|
0
+ @module.send :module_eval, <<-end_eval # We use module_eval to avoid leaks
0
+
0
+ def #{url_helper_name(deprecated_name, kind)}(*args)
0
+
0
+ ActiveSupport::Deprecation.warn(
0
+ 'The named route "#{url_helper_name(deprecated_name, kind)}" uses a format that has been deprecated. ' +
0
+ 'You should use "#{url_helper_name(name, kind)}" instead.', caller
0
+ )
0
+
0
+ send :#{url_helper_name(name, kind)}, *args
0
+
0
+ end
0
+
0
+ def #{hash_access_name(deprecated_name, kind)}(*args)
0
+
0
+ ActiveSupport::Deprecation.warn(
0
+ 'The named route "#{hash_access_name(deprecated_name, kind)}" uses a format that has been deprecated. ' +
0
+ 'You should use "#{hash_access_name(name, kind)}" instead.', caller
0
+ )
0
+
0
+ send :#{hash_access_name(name, kind)}, *args
0
+
0
+ end
0
+
0
+ end_eval
0
+ end
0
+
0
+ end
0
 
0
         private
0
           def url_helper_name(name, kind = :url)
0
@@ -1177,6 +1213,10 @@ module ActionController
0
       def add_named_route(name, path, options = {})
0
         named_routes[name] = add_route(path, options)
0
       end
0
+
0
+ def add_deprecated_named_route(name, deprecated_name)
0
+ named_routes.define_deprecated_named_route_methods(name, deprecated_name)
0
+ end
0
   
0
       def options_as_params(options)
0
         # If an explicit :controller was given, always make :action explicit
...
10
11
12
13
14
 
 
 
15
16
17
...
63
64
65
66
 
67
68
69
70
71
72
 
73
74
75
...
78
79
80
81
 
82
83
84
...
86
87
88
89
 
90
91
92
93
94
95
96
 
97
98
99
...
103
104
105
106
 
107
108
109
...
120
121
122
123
 
124
125
126
...
136
137
138
139
 
140
141
142
...
178
179
180
 
181
182
183
 
184
185
186
...
217
218
219
220
 
221
222
 
223
224
225
...
227
228
229
230
 
231
232
233
...
244
245
246
247
 
248
249
250
...
264
265
266
267
 
268
269
 
270
271
272
...
279
280
281
282
 
283
284
285
 
286
287
288
...
290
291
292
293
 
294
295
 
296
297
298
...
312
313
314
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
315
316
317
...
319
320
321
322
 
323
324
325
...
344
345
346
347
348
 
 
349
350
351
...
395
396
397
398
 
399
400
 
401
402
 
403
404
 
405
406
407
...
410
411
412
413
414
 
 
415
416
417
...
448
449
450
451
452
453
454
455
456
457
 
 
 
 
 
 
 
 
458
459
460
...
10
11
12
 
 
13
14
15
16
17
18
...
64
65
66
 
67
68
69
70
71
72
 
73
74
75
76
...
79
80
81
 
82
83
84
85
...
87
88
89
 
90
91
92
93
94
95
96
 
97
98
99
100
...
104
105
106
 
107
108
109
110
...
121
122
123
 
124
125
126
127
...
137
138
139
 
140
141
142
143
...
179
180
181
182
183
184
185
186
187
188
189
...
220
221
222
 
223
224
 
225
226
227
228
...
230
231
232
 
233
234
235
236
...
247
248
249
 
250
251
252
253
...
267
268
269
 
270
271
 
272
273
274
275
...
282
283
284
 
285
286
287
 
288
289
290
291
...
293
294
295
 
296
297
 
298
299
300
301
...
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
...
497
498
499
 
500
501
502
503
...
522
523
524
 
 
525
526
527
528
529
...
573
574
575
 
576
577
 
578
579
 
580
581
 
582
583
584
585
...
588
589
590
 
 
591
592
593
594
595
...
626
627
628
 
 
 
 
 
 
 
629
630
631
632
633
634
635
636
637
638
639
0
@@ -10,8 +10,9 @@ class ThreadsController < ResourcesController; end
0
 class MessagesController < ResourcesController; end
0
 class CommentsController < ResourcesController; end
0
 
0
-class AccountController < ResourcesController; end
0
-class AdminController < ResourcesController; end
0
+class AccountController < ResourcesController; end
0
+class AdminController < ResourcesController; end
0
+class ProductsController < ResourcesController; end
0
 
0
 class ResourcesTest < Test::Unit::TestCase
0
   def test_should_arrange_actions
0
@@ -63,13 +64,13 @@ class ResourcesTest < Test::Unit::TestCase
0
     end
0
   end
0
 
0
- def test_multile_with_path_prefix
0
+ def test_multiple_with_path_prefix
0
     with_restful_routing :messages, :comments, :path_prefix => '/thread/:thread_id' do
0
       assert_simply_restful_for :messages, :path_prefix => 'thread/5/', :options => { :thread_id => '5' }
0
       assert_simply_restful_for :comments, :path_prefix => 'thread/5/', :options => { :thread_id => '5' }
0
     end
0
   end
0
-
0
+
0
   def test_with_name_prefix
0
     with_restful_routing :messages, :name_prefix => 'post_' do
0
       assert_simply_restful_for :messages, :name_prefix => 'post_'
0
@@ -78,7 +79,7 @@ class ResourcesTest < Test::Unit::TestCase
0
 
0
   def test_with_collection_action
0
     rss_options = {:action => 'rss'}
0
- rss_path = "/messages;rss"
0
+ rss_path = "/messages/rss"
0
     actions = { 'a' => :put, 'b' => :post, 'c' => :delete }
0
 
0
     with_restful_routing :messages, :collection => { :rss => :get }.merge(actions) do
0
@@ -86,14 +87,14 @@ class ResourcesTest < Test::Unit::TestCase
0
         assert_routing rss_path, options.merge(rss_options)
0
 
0
         actions.each do |action, method|
0
- assert_recognizes(options.merge(:action => action), :path => "/messages;#{action}", :method => method)
0
+ assert_recognizes(options.merge(:action => action), :path => "/messages/#{action}", :method => method)
0
         end
0
       end
0
 
0
       assert_restful_named_routes_for :messages do |options|
0
         assert_named_route rss_path, :rss_messages_path, rss_options
0
         actions.keys.each do |action|
0
- assert_named_route