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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e1628c890b14f2fb0d7dd1c269d1acd8d96da310c28f990834b0fed1c33d56cc
4
- data.tar.gz: 9e181312f1785e4ee5ce1900f4a90fc990f520cecdbc67cb166ff9f8ef7b93fb
3
+ metadata.gz: fa39c2f53b7fb3f0259cc276e6a15193f786f559f2895f6c83911867ce30a7ba
4
+ data.tar.gz: cc41b0158409d69a02d534a99c6eac8ff670d3444de76f07378793209308a295
5
5
  SHA512:
6
- metadata.gz: d7de09b2961f9e00b9bf6a5deeac78bfb31ed5f9a249b7ee4c98499da9713fbd6a14422193fee1c26fb20de7fadabbb7233ca7468af997680403bbe6a9ef02b5
7
- data.tar.gz: 3859c4fa95f90cfa13f2dfc2cd728ed7013eb5891deaaf65ff3fd90e54fd3d3d9c1336776b223972711111ebb75e7f47d62865a08c98953550ce39254ae2b807
6
+ metadata.gz: deabeda0af9e9ae4fccb2d742ffc93c740b4639b23ce177edc5dd564c5d8579c372d6ad9ee960e18927d77aa991217badab9b386f99d568fb7b011f4092d9005
7
+ data.tar.gz: cba887138d59aa379e7fc63b896559428472244dbf3c940d10c1d2947f93aa01a29375bd509f5a39d9d31bdabd4463fd66ca41135f14e8bf6220967cf56de924
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## [0.39.2] - 2026-01-27
2
+
3
+ ### 🐛 Bug Fixes
4
+
5
+ - Handle create and update nested routes
1
6
  ## [0.39.1] - 2026-01-26
2
7
 
3
8
  ### 🐛 Bug Fixes
@@ -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 action uses plural (blogging_post_nested_comments)
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 action == :index || (no_record && action != :new)
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
- unless is_singular || no_record
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
 
@@ -1,5 +1,5 @@
1
1
  module Plutonium
2
- VERSION = "0.39.1"
2
+ VERSION = "0.39.2"
3
3
  NEXT_MAJOR_VERSION = VERSION.split(".").tap { |v|
4
4
  v[1] = v[1].to_i + 1
5
5
  v[2] = 0
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radioactive-labs/plutonium",
3
- "version": "0.39.1",
3
+ "version": "0.39.2",
4
4
  "description": "Build production-ready Rails apps in minutes, not days. Convention-driven, fully customizable, AI-ready.",
5
5
  "type": "module",
6
6
  "main": "src/js/core.js",
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.1
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-26 00:00:00.000000000 Z
11
+ date: 2026-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zeitwerk