plutonium 0.39.1 → 0.39.2
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/plutonium/core/controller.rb +9 -5
- data/lib/plutonium/version.rb +1 -1
- data/package.json +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fa39c2f53b7fb3f0259cc276e6a15193f786f559f2895f6c83911867ce30a7ba
|
|
4
|
+
data.tar.gz: cc41b0158409d69a02d534a99c6eac8ff670d3444de76f07378793209308a295
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: deabeda0af9e9ae4fccb2d742ffc93c740b4639b23ce177edc5dd564c5d8579c372d6ad9ee960e18927d77aa991217badab9b386f99d568fb7b011f4092d9005
|
|
7
|
+
data.tar.gz: cba887138d59aa379e7fc63b896559428472244dbf3c940d10c1d2947f93aa01a29375bd509f5a39d9d31bdabd4463fd66ca41135f14e8bf6220967cf56de924
|
data/CHANGELOG.md
CHANGED
|
@@ -154,19 +154,22 @@ module Plutonium
|
|
|
154
154
|
# Determine the helper name based on action and route type
|
|
155
155
|
# For singular routes (has_one), always use the association name as-is (no singularize)
|
|
156
156
|
# For plural routes (has_many):
|
|
157
|
-
# - :index
|
|
157
|
+
# - :index/:create actions use plural (blogging_post_nested_comments) - collection routes
|
|
158
158
|
# - :new action uses singular (new_blogging_post_nested_comment)
|
|
159
|
-
# - member actions (show/edit/destroy) use singular (blogging_post_nested_comment)
|
|
159
|
+
# - member actions (show/edit/update/destroy) use singular (blogging_post_nested_comment)
|
|
160
|
+
is_collection_action = action == :index || action == :create || (no_record && action != :new)
|
|
160
161
|
helper_base = if is_singular
|
|
161
162
|
"#{parent_singular}_#{nested_resource_name}"
|
|
162
|
-
elsif
|
|
163
|
+
elsif is_collection_action
|
|
163
164
|
"#{parent_singular}_#{nested_resource_name}"
|
|
164
165
|
else
|
|
165
166
|
"#{parent_singular}_#{nested_resource_name.to_s.singularize}"
|
|
166
167
|
end
|
|
167
168
|
|
|
169
|
+
# Only add helper prefix for actions that have named route helpers (new, edit)
|
|
170
|
+
# :create/:update use HTTP method to differentiate, not route helper prefix
|
|
168
171
|
helper_suffix = case action
|
|
169
|
-
when :show, nil then ""
|
|
172
|
+
when :show, :create, :update, nil then ""
|
|
170
173
|
else "#{action}_"
|
|
171
174
|
end
|
|
172
175
|
|
|
@@ -175,7 +178,8 @@ module Plutonium
|
|
|
175
178
|
# Build the arguments for the helper
|
|
176
179
|
helper_args = [parent.to_param]
|
|
177
180
|
# Include element ID for plural routes (has_many) when we have a record instance
|
|
178
|
-
|
|
181
|
+
# Skip ID for collection actions (:index, :create) which don't need a member ID
|
|
182
|
+
unless is_singular || no_record || is_collection_action
|
|
179
183
|
helper_args << element.to_param
|
|
180
184
|
end
|
|
181
185
|
|
data/lib/plutonium/version.rb
CHANGED
data/package.json
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: plutonium
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.39.
|
|
4
|
+
version: 0.39.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stefan Froelich
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-01-
|
|
11
|
+
date: 2026-01-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: zeitwerk
|