inherited_resources_helpers 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@ module InheritedResources
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def index_url(options = {})
|
9
|
-
polymorphic_url(parent_resources << resource_class, options)
|
9
|
+
polymorphic_url(parent_resources << resource_class.base_class, options)
|
10
10
|
end
|
11
11
|
|
12
12
|
def new_url(options = {})
|
@@ -31,7 +31,7 @@ module InheritedResources
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def parent_index_url(options = {})
|
34
|
-
polymorphic_url(parent_resources[0..-2] << parent_resources.last.class, options)
|
34
|
+
polymorphic_url(parent_resources[0..-2] << parent_resources.last.class.base_class, options)
|
35
35
|
end
|
36
36
|
|
37
37
|
def parent_new_url(options = {})
|
@@ -56,7 +56,7 @@ module InheritedResources
|
|
56
56
|
raise_invalid_url_helper("children_index_url(#{:child.inspect})", resource) if resource.new_record?
|
57
57
|
polymorphic_url(resources << child.to_s.pluralize, options)
|
58
58
|
end
|
59
|
-
|
59
|
+
|
60
60
|
def children_index_path(*args)
|
61
61
|
children_index_url(*args << args.extract_options!.reverse_merge(:routing_type => :path))
|
62
62
|
end
|
@@ -65,7 +65,7 @@ module InheritedResources
|
|
65
65
|
raise_invalid_url_helper("children_new_url(#{:child.inspect})", resource) if resource.new_record?
|
66
66
|
polymorphic_url(resources.unshift(:new) << child.to_s.singularize, options)
|
67
67
|
end
|
68
|
-
|
68
|
+
|
69
69
|
def children_new_path(*args)
|
70
70
|
children_new_url(*args << args.extract_options!.reverse_merge(:routing_type => :path))
|
71
71
|
end
|
@@ -81,9 +81,9 @@ module InheritedResources
|
|
81
81
|
|
82
82
|
alias :parent_resource_url :parent_show_url
|
83
83
|
alias :parent_resource_path :parent_show_path
|
84
|
-
|
84
|
+
|
85
85
|
protected
|
86
|
-
|
86
|
+
|
87
87
|
def raise_invalid_url_helper(method, resource)
|
88
88
|
raise "can't generate #{method} because the current resource (#{resource.inspect}) is a new record"
|
89
89
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inherited_resources_helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Sven Fuchs
|