plutonium 0.33.0 → 0.33.1

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: 0fe003ede858d6f1486a48317e5fd400d02bf0571371815fe5c4204947e63da7
4
- data.tar.gz: 8744546ac010a29deab0ac0b90429ecef34670f21dfd78b251536570417e1bed
3
+ metadata.gz: '09404b41e07186fad2cd1b8cac7d13dcf24365020bd421fbe1f2991a9368ac73'
4
+ data.tar.gz: dfc8ca35be7e90674dd76b0a2bef5f3815adb01c36dd0bc287fe29707710f576
5
5
  SHA512:
6
- metadata.gz: 6bdaa1b4b5984c9773cdd5b65e981c54b8974e26b244a1a951c4bc5ffbbb2e2502aff5cee0c5d42d2af4a1b3a8fbf1c0875ee6c3506f95a6043b8eb50785e35c
7
- data.tar.gz: 9b9d2c38021646d2fc831618e50d9fd8f8e6dd626ca651986e3ac2431ca1709eab130d46217da809d626c35f84d5e8b08f5d482a4dfdcfad761fb55b058727e9
6
+ metadata.gz: 5732daa2516ac0120f244649d78a62a5824dc7ec976783cfc0b806b27a424372021935b099602f36348dd72a0825c994e579dbbccaae08f4e8241861bee3816c
7
+ data.tar.gz: 95a474cc9f548b10c929ce170de2fc9e39886fe5f579620aa5748a2d62927c663ba270689d87345b9c75df1dd43f440ceebc61b0f840bd1d1e80d4fdb27083bb
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## [0.33.1] - 2026-01-14
2
+
3
+ ### 🐛 Bug Fixes
4
+
5
+ - *(controllers)* Handle turbo_stream format in CRUD and interactive actions
1
6
  ## [0.33.0] - 2026-01-12
2
7
 
3
8
  ### ◀️ Revert
@@ -16,7 +16,10 @@ module Plutonium
16
16
 
17
17
  setup_index_action!
18
18
 
19
- render :index
19
+ respond_to do |format|
20
+ format.any(:html, :turbo_stream) { render :index, formats: [:html] }
21
+ format.any { render :index }
22
+ end
20
23
  end
21
24
 
22
25
  # GET /resources/1(.{format})
@@ -24,7 +27,10 @@ module Plutonium
24
27
  authorize_current! resource_record!
25
28
  set_page_title resource_record!.to_label.titleize
26
29
 
27
- render :show
30
+ respond_to do |format|
31
+ format.any(:html, :turbo_stream) { render :show, formats: [:html] }
32
+ format.any { render :show }
33
+ end
28
34
  end
29
35
 
30
36
  # GET /resources/new
@@ -35,7 +41,7 @@ module Plutonium
35
41
  @resource_record = resource_class.new
36
42
  maybe_apply_submitted_resource_params!
37
43
 
38
- render :new
44
+ render :new, formats: [:html]
39
45
  end
40
46
 
41
47
  # POST /resources(.{format})
@@ -47,9 +53,9 @@ module Plutonium
47
53
 
48
54
  respond_to do |format|
49
55
  if params[:pre_submit]
50
- format.html { render :new, status: :unprocessable_content }
56
+ format.any(:html, :turbo_stream) { render :new, formats: [:html], status: :unprocessable_content }
51
57
  elsif resource_record!.save
52
- format.html do
58
+ format.any(:html, :turbo_stream) do
53
59
  redirect_to redirect_url_after_submit,
54
60
  notice: "#{resource_class.model_name.human} was successfully created."
55
61
  end
@@ -60,7 +66,7 @@ module Plutonium
60
66
  location: redirect_url_after_submit
61
67
  end
62
68
  else
63
- format.html { render :new, status: :unprocessable_content }
69
+ format.any(:html, :turbo_stream) { render :new, formats: [:html], status: :unprocessable_content }
64
70
  format.any do
65
71
  @errors = resource_record!.errors
66
72
  render "errors", status: :unprocessable_content
@@ -76,7 +82,7 @@ module Plutonium
76
82
 
77
83
  maybe_apply_submitted_resource_params!
78
84
 
79
- render :edit
85
+ render :edit, formats: [:html]
80
86
  end
81
87
 
82
88
  # PATCH/PUT /resources/1(.{format})
@@ -88,19 +94,18 @@ module Plutonium
88
94
 
89
95
  respond_to do |format|
90
96
  if params[:pre_submit]
91
- format.html { render :edit, status: :unprocessable_content }
97
+ format.any(:html, :turbo_stream) { render :edit, formats: [:html], status: :unprocessable_content }
92
98
  elsif resource_record!.save
93
- format.html do
99
+ format.any(:html, :turbo_stream) do
94
100
  redirect_to redirect_url_after_submit,
95
- notice:
96
- "#{resource_class.model_name.human} was successfully updated.",
101
+ notice: "#{resource_class.model_name.human} was successfully updated.",
97
102
  status: :see_other
98
103
  end
99
104
  format.any do
100
105
  render :show, status: :ok, location: redirect_url_after_submit
101
106
  end
102
107
  else
103
- format.html { render :edit, status: :unprocessable_content }
108
+ format.any(:html, :turbo_stream) { render :edit, formats: [:html], status: :unprocessable_content }
104
109
  format.any do
105
110
  @errors = resource_record!.errors
106
111
  render "errors", status: :unprocessable_content
@@ -116,17 +121,15 @@ module Plutonium
116
121
  respond_to do |format|
117
122
  resource_record!.destroy
118
123
 
119
- format.html do
124
+ format.any(:html, :turbo_stream) do
120
125
  redirect_to redirect_url_after_destroy,
121
- notice:
122
- "#{resource_class.model_name.human} was successfully deleted."
126
+ notice: "#{resource_class.model_name.human} was successfully deleted."
123
127
  end
124
128
  format.json { head :no_content }
125
129
  rescue ActiveRecord::InvalidForeignKey
126
- format.html do
130
+ format.any(:html, :turbo_stream) do
127
131
  redirect_to resource_url_for(resource_record!),
128
- alert:
129
- "#{resource_class.model_name.human} is referenced by other records."
132
+ alert: "#{resource_class.model_name.human} is referenced by other records."
130
133
  end
131
134
  format.any do
132
135
  @errors = ActiveModel::Errors.new resource_record!
@@ -28,9 +28,9 @@ module Plutonium
28
28
  build_interactive_record_action_interaction
29
29
 
30
30
  if helpers.current_turbo_frame == "remote_modal"
31
- render layout: false
31
+ render layout: false, formats: [:html]
32
32
  else
33
- render :interactive_record_action
33
+ render :interactive_record_action, formats: [:html]
34
34
  end
35
35
  end
36
36
 
@@ -39,11 +39,7 @@ module Plutonium
39
39
  build_interactive_record_action_interaction
40
40
 
41
41
  if params[:pre_submit]
42
- respond_to do |format|
43
- format.html do
44
- render :interactive_record_action, status: :unprocessable_content
45
- end
46
- end
42
+ render :interactive_record_action, formats: [:html], status: :unprocessable_content
47
43
  return
48
44
  end
49
45
 
@@ -54,8 +50,6 @@ module Plutonium
54
50
  if outcome.success?
55
51
  return_url = redirect_url_after_action_on(resource_record!)
56
52
 
57
- format.any { redirect_to return_url, status: :see_other }
58
-
59
53
  if helpers.current_turbo_frame == "remote_modal"
60
54
  format.turbo_stream do
61
55
  render turbo_stream: [
@@ -63,16 +57,16 @@ module Plutonium
63
57
  ]
64
58
  end
65
59
  end
60
+
61
+ format.any { redirect_to return_url, status: :see_other }
66
62
  else
67
- format.html do
68
- render :interactive_record_action, status: :unprocessable_content
63
+ format.any(:html, :turbo_stream) do
64
+ render :interactive_record_action, formats: [:html], status: :unprocessable_content
69
65
  end
70
-
71
66
  format.any do
72
67
  @errors = @interaction.errors
73
68
  render "errors", status: :unprocessable_content
74
69
  end
75
-
76
70
  end
77
71
  end
78
72
  end
@@ -83,10 +77,14 @@ module Plutonium
83
77
  skip_verify_current_authorized_scope!
84
78
  build_interactive_resource_action_interaction
85
79
 
86
- if helpers.current_turbo_frame == "remote_modal"
87
- render layout: false
88
- else
89
- render :interactive_resource_action
80
+ respond_to do |format|
81
+ format.any(:html, :turbo_stream) do
82
+ if helpers.current_turbo_frame == "remote_modal"
83
+ render layout: false, formats: [:html]
84
+ else
85
+ render :interactive_resource_action, formats: [:html]
86
+ end
87
+ end
90
88
  end
91
89
  end
92
90
 
@@ -97,8 +95,8 @@ module Plutonium
97
95
 
98
96
  if params[:pre_submit]
99
97
  respond_to do |format|
100
- format.html do
101
- render :interactive_resource_action, status: :unprocessable_content
98
+ format.any(:html, :turbo_stream) do
99
+ render :interactive_resource_action, formats: [:html], status: :unprocessable_content
102
100
  end
103
101
  end
104
102
  return
@@ -111,8 +109,6 @@ module Plutonium
111
109
  if outcome.success?
112
110
  return_url = redirect_url_after_action_on(resource_class)
113
111
 
114
- format.any { redirect_to return_url, status: :see_other }
115
-
116
112
  if helpers.current_turbo_frame == "remote_modal"
117
113
  format.turbo_stream do
118
114
  render turbo_stream: [
@@ -120,16 +116,16 @@ module Plutonium
120
116
  ]
121
117
  end
122
118
  end
119
+
120
+ format.any { redirect_to return_url, status: :see_other }
123
121
  else
124
- format.html do
125
- render :interactive_resource_action, status: :unprocessable_content
122
+ format.any(:html, :turbo_stream) do
123
+ render :interactive_resource_action, formats: [:html], status: :unprocessable_content
126
124
  end
127
-
128
125
  format.any do
129
126
  @errors = @interaction.errors
130
127
  render "errors", status: :unprocessable_content
131
128
  end
132
-
133
129
  end
134
130
  end
135
131
  end
@@ -1,5 +1,5 @@
1
1
  module Plutonium
2
- VERSION = "0.33.0"
2
+ VERSION = "0.33.1"
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.33.0",
3
+ "version": "0.33.1",
4
4
  "description": "Core assets for the Plutonium gem",
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.33.0
4
+ version: 0.33.1
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-12 00:00:00.000000000 Z
11
+ date: 2026-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zeitwerk