backstage 0.1.16 → 0.1.17
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 +11 -0
- data/app/controllers/backstage/resources_controller.rb +4 -2
- data/app/views/backstage/resources/edit.html.erb +9 -0
- data/app/views/backstage/resources/new.html.erb +9 -0
- data/app/views/layouts/backstage/backstage.html.erb +8 -0
- data/lib/backstage/version.rb +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: daa88b222f8f96e18685ccb3fd5aa7df2b7123a0000e65eb75ed567e3241b4b9
|
|
4
|
+
data.tar.gz: 33a3c9b348029ccb14da21801174769d11481e332735ce923f2b1e2d15799691
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 889e54bc4ab50f29711be9c3dbf5de0afc06855affbede4bf3fd56d9f8131be3c1877dc273bb39f7448cb428ef9d9bedd15c7e00756d37094a2857396b9326cc
|
|
7
|
+
data.tar.gz: 6569763f092592c84fccb96f4bbd3bf589a97ef26a13c07fbcf1441c39ba1f32805c1ed7a2e638a814f46d68ad7a59646c0a1461ade2d28fbc33d156b71534d7
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,17 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.1.17] — 2026-06-04
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Flash notice is displayed after a successful create or update
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- Edit and new forms now render validation error messages inline when save fails
|
|
19
|
+
- Successful update now redirects back to the edit page instead of the index
|
|
20
|
+
|
|
10
21
|
## [0.1.16] — 2026-06-02
|
|
11
22
|
|
|
12
23
|
### Fixed
|
|
@@ -40,7 +40,8 @@ module Backstage
|
|
|
40
40
|
def create
|
|
41
41
|
@record = @resource_config.model_class.new(record_params)
|
|
42
42
|
if @record.save
|
|
43
|
-
redirect_to edit_resource_path(resource: params[:resource], id: @record.id)
|
|
43
|
+
redirect_to edit_resource_path(resource: params[:resource], id: @record.id),
|
|
44
|
+
notice: "#{@resource_config.model_class.model_name.human} was successfully created."
|
|
44
45
|
else
|
|
45
46
|
render :new, status: :unprocessable_entity
|
|
46
47
|
end
|
|
@@ -48,7 +49,8 @@ module Backstage
|
|
|
48
49
|
|
|
49
50
|
def update
|
|
50
51
|
if @record.update(record_params)
|
|
51
|
-
redirect_to
|
|
52
|
+
redirect_to edit_resource_path(resource: params[:resource], id: @record.id),
|
|
53
|
+
notice: "#{@resource_config.model_class.model_name.human} was successfully saved."
|
|
52
54
|
else
|
|
53
55
|
render :edit, status: :unprocessable_entity
|
|
54
56
|
end
|
|
@@ -4,6 +4,15 @@
|
|
|
4
4
|
<div<% if sidebar&.links&.any? %> class="edit-layout"<% end %>>
|
|
5
5
|
<div>
|
|
6
6
|
<%= form_with model: @record, url: resource_path(resource: params[:resource], id: @record.id), method: :patch do |f| %>
|
|
7
|
+
<% if @record.errors.any? %>
|
|
8
|
+
<div class="error-messages">
|
|
9
|
+
<ul>
|
|
10
|
+
<% @record.errors.full_messages.each do |msg| %>
|
|
11
|
+
<li><%= msg %></li>
|
|
12
|
+
<% end %>
|
|
13
|
+
</ul>
|
|
14
|
+
</div>
|
|
15
|
+
<% end %>
|
|
7
16
|
<% @resource_config.edit_fields.each do |field| %>
|
|
8
17
|
<% if field.container? %>
|
|
9
18
|
<%= render partial: field.partial_path, locals: { f: f, field: field, record: @record } %>
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
<h1>New <%= @resource_config.model_class.model_name.human %></h1>
|
|
2
2
|
|
|
3
3
|
<%= form_with model: @record, url: resources_path(resource: params[:resource]), method: :post do |f| %>
|
|
4
|
+
<% if @record.errors.any? %>
|
|
5
|
+
<div class="error-messages">
|
|
6
|
+
<ul>
|
|
7
|
+
<% @record.errors.full_messages.each do |msg| %>
|
|
8
|
+
<li><%= msg %></li>
|
|
9
|
+
<% end %>
|
|
10
|
+
</ul>
|
|
11
|
+
</div>
|
|
12
|
+
<% end %>
|
|
4
13
|
<% @resource_config.edit_fields.each do |field| %>
|
|
5
14
|
<% if field.container? %>
|
|
6
15
|
<%= render partial: field.partial_path, locals: { f: f, field: field, record: @record } %>
|
|
@@ -60,6 +60,14 @@
|
|
|
60
60
|
</ul>
|
|
61
61
|
</nav>
|
|
62
62
|
<main>
|
|
63
|
+
<div id="flash">
|
|
64
|
+
<% if flash[:notice] %>
|
|
65
|
+
<p class="notice"><%= flash[:notice] %></p>
|
|
66
|
+
<% end %>
|
|
67
|
+
<% if flash[:alert] %>
|
|
68
|
+
<p class="alert"><%= flash[:alert] %></p>
|
|
69
|
+
<% end %>
|
|
70
|
+
</div>
|
|
63
71
|
<%= yield %>
|
|
64
72
|
</main>
|
|
65
73
|
</body>
|
data/lib/backstage/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: backstage
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.17
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gareth James
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-06-
|
|
11
|
+
date: 2026-06-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: railties
|