josevalim-inherited_resources 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +5 -0
- data/README +8 -8
- data/lib/inherited_resources/base.rb +1 -0
- metadata +1 -1
data/CHANGELOG
CHANGED
data/README
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Inherited Resources
|
2
2
|
License: MIT
|
3
|
-
Version: 0.4.
|
3
|
+
Version: 0.4.2
|
4
4
|
|
5
5
|
You can also read this README in pretty html at the GitHub project Wiki page:
|
6
6
|
|
@@ -407,12 +407,12 @@ And they handle everything for you. :)
|
|
407
407
|
collection_url # => /posts/1/comments
|
408
408
|
|
409
409
|
# /projects/1/tasks
|
410
|
-
resource_url # => /
|
411
|
-
resource_url(task) # => /
|
412
|
-
new_resource_url # => /
|
413
|
-
edit_resource_url # => /
|
414
|
-
edit_resource_url(task) # => /
|
415
|
-
collection_url # => /
|
410
|
+
resource_url # => /projects/1/tasks/#{@task.to_param}
|
411
|
+
resource_url(task) # => /projects/1/tasks/#{task.to_param}
|
412
|
+
new_resource_url # => /projects/1/tasks/new
|
413
|
+
edit_resource_url # => /projects/1/tasks/#{@task.to_param}/edit
|
414
|
+
edit_resource_url(task) # => /projects/1/tasks/#{task.to_param}/edit
|
415
|
+
collection_url # => /projects/1/tasks
|
416
416
|
|
417
417
|
# /users
|
418
418
|
resource_url # => /users/#{@user.to_param}
|
@@ -425,7 +425,7 @@ And they handle everything for you. :)
|
|
425
425
|
Those urls helpers also accepts a hash as options, just as in named routes.
|
426
426
|
|
427
427
|
# /projects/1/tasks
|
428
|
-
collection_url(:page => 1, :limit => 10) #=> /
|
428
|
+
collection_url(:page => 1, :limit => 10) #=> /projects/1/tasks?page=1&limit=10
|
429
429
|
|
430
430
|
Another nice thing is that those urls are not guessed during runtime. They are
|
431
431
|
all created when your application is loaded (except for polymorphic
|
@@ -166,6 +166,7 @@ require File.dirname(__FILE__) + '/class_methods.rb'
|
|
166
166
|
require File.dirname(__FILE__) + '/dumb_responder.rb'
|
167
167
|
require File.dirname(__FILE__) + '/polymorphic_helpers.rb'
|
168
168
|
require File.dirname(__FILE__) + '/singleton_helpers.rb'
|
169
|
+
require File.dirname(__FILE__) + '/spec.rb'
|
169
170
|
require File.dirname(__FILE__) + '/url_helpers.rb'
|
170
171
|
|
171
172
|
module InheritedResources
|