b4um_generators 0.4.2 → 0.5.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: c28062a0ee906885d252d4f10519103efd322fb0b4543f4e2c50583e806cb8eb
4
- data.tar.gz: 914c0f060ab2e9f27ab11441f66c822696c7d2c928038880fb2c31f2c6113546
3
+ metadata.gz: 6be3f0b7860fd76276d56a1656a8cbf149d590d9684f16bc8b208ed1aa9adbc7
4
+ data.tar.gz: 139cf83e17e3164c3a83cbcd3c6fbe0c3101932faa86d8e0922c389f7e4013b1
5
5
  SHA512:
6
- metadata.gz: 8f0e80c477c65da9362ea6bff1c23760d620a639e40cda8ab3070ff2e6389dd70cb305bce39ea837259a1ed5d5ca33273217f87f8037d607d3774b9d60ffa155
7
- data.tar.gz: b94e7e85275276d551a090797bf08bccaabfe90e89ab9ed10d9b2208a1e092605eb563411fd79700b8a0e5bbf1e4042d093c3688cd9d160733daa5cf54a0b5e2
6
+ metadata.gz: df66e4e64b8c164ba7672239eafd2e4e3fc477498966130c0afa8d7d536602a0373b7f45bb265f26698d2aa4d3085db98551aa5062071c471ca4d3a993b70a39
7
+ data.tar.gz: 8cdaed723ccfde18308962ac754c6a493d26b6be6ea7da3ec9b37904a7842be3969a550c8b025763933a997b641428fe0d952660d04f227eaec04538d708672c
data/CHANGELOG.md CHANGED
@@ -4,6 +4,53 @@ All notable changes to b4um Generators will be documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.5.1] - 2026-10-14
8
+
9
+ ### Added
10
+
11
+ - Added optional `--login-path` configuration to the Todo generator
12
+ - Added validation for custom login route helpers
13
+ - Added RSpec coverage for default, custom and invalid login routes
14
+
15
+ ### Fixed
16
+
17
+ - Fixed unauthenticated access to personal Todo lists by redirecting users to the login page instead of returning HTTP
18
+ 401
19
+ - Preserved public Todo list access without authentication requirements
20
+
21
+ ### Changed
22
+
23
+ - Kept `login_path` as the default route for b4um authentication
24
+ - Updated English and German README documentation
25
+ - Verified the complete generator suite with 507 RSpec examples and 0 failures
26
+
27
+ ## [0.5.0] - 2026-10-14
28
+
29
+ ### Added
30
+
31
+ - Added complete Todo application generator with `b4um:todo`
32
+ - Added task creation, completion, reopening and deletion
33
+ - Added separate lists for open and completed tasks
34
+ - Added automatic task counters and progress tracking
35
+ - Added progress bar with completion percentage
36
+ - Added Turbo Stream updates without full page reloads
37
+ - Added Stimulus controller for task input handling
38
+ - Added automatic input reset after successful task creation
39
+ - Added responsive Todo layout with b4um cards and floating labels
40
+ - Added light and dark mode support for Todo components
41
+ - Added optional `--owner=MODEL` support for personal Todo lists
42
+ - Added integration with b4um authentication and current account helpers
43
+ - Added owner-specific task access protection
44
+ - Added HTTP 401 responses for unauthenticated owner-specific Todo requests
45
+ - Added 35 RSpec examples for the Todo generator
46
+
47
+ ### Changed
48
+
49
+ - Extended `b4um:help` with Todo generator documentation
50
+ - Extended Help generator RSpec coverage for Todo
51
+ - Updated English and German README documentation
52
+ - Updated the generator overview to include `b4um:todo`
53
+
7
54
  ## [0.4.2] - 2026-10-13
8
55
 
9
56
  ### Fixed
data/README.de.md CHANGED
@@ -6,8 +6,8 @@ b4um Generators ist eine Sammlung wiederverwendbarer Rails-Generatoren, Template
6
6
  für b4um-Rails-Projekte.
7
7
 
8
8
  Das Gem bietet eine einheitliche Grundlage für Rails-Anwendungen und enthält Generatoren für Scaffolds, Controller,
9
- Bento-Layouts, Tabellen, Pagination, Infinite Scroll, Suche, Kommentare, Authentifizierung, Administration, Gastzugänge,
10
- Attachments und Rich-Text-Bearbeitung.
9
+ Bento-Layouts, Tabellen, Pagination, Infinite Scroll, Suche, Sortierung, Todo-Listen, Kommentare, Authentifizierung,
10
+ Administration, Gastzugänge, Attachments und Rich-Text-Bearbeitung.
11
11
 
12
12
  Die generierten Komponenten verwenden ein gemeinsames b4um-Styling und sind darauf ausgelegt, miteinander zu
13
13
  funktionieren.
@@ -24,7 +24,7 @@ b4um Generators wird während der Entwicklung derzeit als lokales Gem verwendet.
24
24
  Füge das Gem zur `Gemfile` der Rails-Anwendung hinzu:
25
25
 
26
26
  ```ruby
27
- gem "b4um_generators", "~> 0.4.2", path: "/pfad/zu/b4um_generators"
27
+ gem "b4um_generators", "~> 0.5.1", path: "/pfad/zu/b4um_generators"
28
28
  ```
29
29
 
30
30
  Führe anschließend aus:
@@ -82,6 +82,7 @@ b4um:pagination
82
82
  b4um:infinite_scroll
83
83
  b4um:search
84
84
  b4um:sortable
85
+ b4um:todo
85
86
  b4um:comments
86
87
  b4um:in_place
87
88
  b4um:authentication
@@ -1146,6 +1147,132 @@ Dadurch entstehen entsprechend `/produktuebersicht`, `/verwaltung` und `/admin`.
1146
1147
  Eine separate Sortierseite ermöglicht außerdem, nur die `sort`-Action durch die Authentifizierung zu schützen, während
1147
1148
  der normale Ressourcen-Index öffentlich bleiben kann.
1148
1149
 
1150
+ ## Todo
1151
+
1152
+ Erzeuge eine vollständige Todo-Anwendung mit Turbo Streams, Stimulus und dem einheitlichen b4um-Styling:
1153
+
1154
+ ```bash
1155
+ bin/rails generate b4um:todo Task
1156
+ bin/rails db:migrate
1157
+ ```
1158
+
1159
+ Der Generator erstellt eine sofort verwendbare Aufgabenliste, ohne dass ein zusätzliches Todo-Gem erforderlich ist.
1160
+
1161
+ Standardmäßig werden Aufgaben gemeinsam innerhalb der Anwendung verwaltet und sind keinem einzelnen Benutzer zugeordnet.
1162
+
1163
+ Die generierte Todo-Anwendung ist erreichbar unter:
1164
+
1165
+ ```text
1166
+ /tasks
1167
+ ```
1168
+
1169
+ ### Funktionen
1170
+
1171
+ Der Todo-Generator bietet:
1172
+
1173
+ - Neue Aufgaben erstellen
1174
+ - Aufgaben als erledigt markieren
1175
+ - Erledigte Aufgaben wieder öffnen
1176
+ - Aufgaben löschen
1177
+ - Getrennte Listen für offene und erledigte Aufgaben
1178
+ - Automatische Aufgabenzähler
1179
+ - Fortschrittsbalken mit prozentualer Anzeige
1180
+ - Aktualisierungen mit Turbo Streams ohne vollständiges Neuladen der Seite
1181
+ - Stimulus-Controller für die Aufgabeneingabe
1182
+ - Automatisches Zurücksetzen des Eingabefeldes nach erfolgreicher Erstellung
1183
+ - b4um Floating Labels
1184
+ - Responsives b4um-Kartenlayout
1185
+ - Unterstützung für Light Mode und Dark Mode
1186
+ - Optionale Zuordnung zu einem Benutzerkonto
1187
+ - Zugriffsschutz für benutzerspezifische Aufgaben
1188
+
1189
+ ### Persönliche Todo-Listen
1190
+
1191
+ Todo-Listen können optional einem Authentifizierungsmodell zugeordnet werden.
1192
+
1193
+ Mit `--owner` werden Aufgaben einzelnen Benutzern zugewiesen:
1194
+
1195
+ ```bash
1196
+ bin/rails generate b4um:todo Task --owner=User
1197
+ bin/rails db:migrate
1198
+ ```
1199
+
1200
+ Das angegebene Benutzer- beziehungsweise Eigentümermodell muss bereits existieren.
1201
+
1202
+ Wird ein Eigentümermodell angegeben, erhält jedes angemeldete Benutzerkonto seine eigene Todo-Liste.
1203
+
1204
+ Die Aufgaben werden über die Verknüpfung des aktuell angemeldeten Kontos geladen. Dadurch können Benutzer nicht auf
1205
+ Aufgaben anderer Konten zugreifen.
1206
+
1207
+ Nicht angemeldete Benutzer werden automatisch zur Login-Seite weitergeleitet.
1208
+
1209
+ Standardmäßig verwendet der Generator den Route-Helper `login_path` aus dem b4um-Authentifizierungssystem.
1210
+
1211
+ Optional kann eine andere Login-Route angegeben werden:
1212
+
1213
+ ```bash
1214
+ bin/rails generate b4um:todo Task --owner=User --login-path=new_user_session_path
1215
+ ```
1216
+
1217
+ Die Option `--login-path` ist freiwillig. Wird sie nicht angegeben, verwendet der Generator automatisch `login_path`.
1218
+
1219
+ Öffentliche Todo-Listen, die ohne `--owner` erstellt werden, benötigen keine Anmeldung und leiten Benutzer nicht zur
1220
+ Login-Seite weiter.
1221
+
1222
+ ### Integration mit der Authentifizierung
1223
+
1224
+ Der Todo-Generator arbeitet mit dem bestehenden b4um-Authentifizierungssystem zusammen.
1225
+
1226
+ Ein vollständiges Beispiel:
1227
+
1228
+ ```bash
1229
+ bin/rails generate b4um:scaffold User name:string email:string password_digest:string
1230
+ bin/rails db:migrate
1231
+
1232
+ bin/rails generate b4um:authentication User
1233
+
1234
+ bin/rails generate b4um:todo Task --owner=User
1235
+ bin/rails db:migrate
1236
+ ```
1237
+
1238
+ Die Passwort-Authentifizierung benötigt bcrypt. Dieses kann über `b4um:install` installiert werden.
1239
+
1240
+ Die Option `--owner` unterstützt auch andere Authentifizierungsmodelle:
1241
+
1242
+ ```bash
1243
+ bin/rails generate b4um:todo Task --owner=Member
1244
+ bin/rails generate b4um:todo Task --owner=Customer
1245
+ ```
1246
+
1247
+ Der generierte Controller verwendet automatisch den zum Modell passenden Helper für das aktuell angemeldete Konto:
1248
+
1249
+ ```ruby
1250
+ current_user
1251
+ current_member
1252
+ current_customer
1253
+ ```
1254
+
1255
+ ### Generierte Dateien
1256
+
1257
+ Für das standardmäßige `Task`-Modell erstellt der Generator folgende Komponenten:
1258
+
1259
+ - Task-Modell und Datenbankmigration
1260
+ - Tasks-Controller
1261
+ - Ressourcen-Routen
1262
+ - Todo-Index-View
1263
+ - Task-Partial
1264
+ - Fortschritts-Partial
1265
+ - Todo-Stylesheet
1266
+ - Stimulus-Controller
1267
+
1268
+ Nach dem Generieren muss die Datenbankmigration ausgeführt werden:
1269
+
1270
+ ```bash
1271
+ bin/rails db:migrate
1272
+ ```
1273
+
1274
+ Anschließend kann die Todo-Anwendung verwendet werden.
1275
+
1149
1276
  ## Kommentare
1150
1277
 
1151
1278
  Füge einem bestehenden Modell polymorphe Kommentare hinzu:
@@ -1549,7 +1676,7 @@ wird.
1549
1676
 
1550
1677
  ## Version
1551
1678
 
1552
- Aktuelle Version: `0.4.2`
1679
+ Aktuelle Version: `0.5.1`
1553
1680
 
1554
1681
  ## Autor
1555
1682
 
data/README.md CHANGED
@@ -6,8 +6,8 @@ b4um Generators is a collection of reusable Rails generators, templates, compone
6
6
  Rails projects.
7
7
 
8
8
  The gem provides a consistent starting point for Rails applications and includes generators for scaffolds, controllers,
9
- Bento layouts, tables, pagination, infinite scrolling, search, sorting, comments, authentication, administrator
10
- management, guest access, attachments and rich-text editing.
9
+ Bento layouts, tables, pagination, infinite scrolling, search, sorting, Todo lists, comments, authentication,
10
+ administrator management, guest access, attachments and rich-text editing.
11
11
 
12
12
  Generated components share the same b4um styling and are designed to work together.
13
13
 
@@ -23,7 +23,7 @@ b4um Generators is currently used as a local gem during development.
23
23
  Add the gem to the Rails application's `Gemfile`:
24
24
 
25
25
  ```ruby
26
- gem "b4um_generators", "~> 0.4.2", path: "/path/to/b4um_generators"
26
+ gem "b4um_generators", "~> 0.5.1", path: "/path/to/b4um_generators"
27
27
  ```
28
28
 
29
29
  Then run:
@@ -80,6 +80,7 @@ b4um:pagination
80
80
  b4um:infinite_scroll
81
81
  b4um:search
82
82
  b4um:sortable
83
+ b4um:todo
83
84
  b4um:comments
84
85
  b4um:in_place
85
86
  b4um:authentication
@@ -1125,6 +1126,131 @@ These create `/produktuebersicht`, `/verwaltung`, and `/admin` respectively.
1125
1126
  Using a separate sortable page also makes it possible to protect only the `sort` action with authentication while
1126
1127
  keeping the regular resource index public.
1127
1128
 
1129
+ ## Todo
1130
+
1131
+ Generate a complete Todo application with Turbo Streams, Stimulus and b4um styling:
1132
+
1133
+ ```bash
1134
+ bin/rails generate b4um:todo Task
1135
+ bin/rails db:migrate
1136
+ ```
1137
+
1138
+ The generator creates a ready-to-use Todo list without requiring an additional Todo gem.
1139
+
1140
+ By default, tasks are shared across the application and are not assigned to individual users.
1141
+
1142
+ The generated Todo application is available at:
1143
+
1144
+ ```text
1145
+ /tasks
1146
+ ```
1147
+
1148
+ ### Features
1149
+
1150
+ The Todo generator provides:
1151
+
1152
+ - Create new tasks
1153
+ - Mark tasks as completed
1154
+ - Reopen completed tasks
1155
+ - Delete tasks
1156
+ - Separate lists for open and completed tasks
1157
+ - Automatic task counters
1158
+ - Progress bar with completion percentage
1159
+ - Turbo Stream updates without full page reloads
1160
+ - Stimulus controller for task input handling
1161
+ - Automatic input reset after successful creation
1162
+ - b4um floating labels
1163
+ - Responsive b4um card layout
1164
+ - Light and dark mode support
1165
+ - Optional owner association
1166
+ - Owner-specific task access protection
1167
+
1168
+ ### Personal Todo Lists
1169
+
1170
+ Todo lists can optionally be associated with an authentication model.
1171
+
1172
+ Use `--owner` to assign tasks to individual users:
1173
+
1174
+ ```bash
1175
+ bin/rails generate b4um:todo Task --owner=User
1176
+ bin/rails db:migrate
1177
+ ```
1178
+
1179
+ The owner model must already exist.
1180
+
1181
+ When an owner is configured, each authenticated account has its own Todo list.
1182
+
1183
+ Tasks are loaded through the current owner's association, preventing users from accessing tasks belonging to another
1184
+ account.
1185
+
1186
+ Unauthenticated users are automatically redirected to the login page.
1187
+
1188
+ By default, the generator uses the `login_path` route helper provided by the b4um authentication system.
1189
+
1190
+ You can optionally specify a different login route:
1191
+
1192
+ ```bash
1193
+ bin/rails generate b4um:todo Task --owner=User --login-path=new_user_session_path
1194
+ ```
1195
+
1196
+ The `--login-path` option is optional. If omitted, `login_path` is used.
1197
+
1198
+ Public Todo lists generated without `--owner` do not require authentication and do not redirect users to a login page.
1199
+
1200
+ ### Authentication Integration
1201
+
1202
+ The Todo generator integrates with the existing b4um authentication system.
1203
+
1204
+ A complete example:
1205
+
1206
+ ```bash
1207
+ bin/rails generate b4um:scaffold User name:string email:string password_digest:string
1208
+ bin/rails db:migrate
1209
+
1210
+ bin/rails generate b4um:authentication User
1211
+
1212
+ bin/rails generate b4um:todo Task --owner=User
1213
+ bin/rails db:migrate
1214
+ ```
1215
+
1216
+ Password authentication requires bcrypt, which can be installed through `b4um:install`.
1217
+
1218
+ The owner option also supports other authentication models:
1219
+
1220
+ ```bash
1221
+ bin/rails generate b4um:todo Task --owner=Member
1222
+ bin/rails generate b4um:todo Task --owner=Customer
1223
+ ```
1224
+
1225
+ The generated controller uses the corresponding current account helper:
1226
+
1227
+ ```ruby
1228
+ current_user
1229
+ current_member
1230
+ current_customer
1231
+ ```
1232
+
1233
+ ### Generated Files
1234
+
1235
+ For the default `Task` model, the generator creates the following components:
1236
+
1237
+ - Task model and database migration
1238
+ - Tasks controller
1239
+ - Resource routes
1240
+ - Todo index view
1241
+ - Task partial
1242
+ - Progress partial
1243
+ - Todo stylesheet
1244
+ - Stimulus controller
1245
+
1246
+ After generation, run:
1247
+
1248
+ ```bash
1249
+ bin/rails db:migrate
1250
+ ```
1251
+
1252
+ The Todo application is then ready to use.
1253
+
1128
1254
  ## Comments
1129
1255
 
1130
1256
  Add polymorphic comments to an existing model:
@@ -1524,7 +1650,7 @@ The gem can be tested locally by referencing the repository with `path:` from a
1524
1650
 
1525
1651
  ## Version
1526
1652
 
1527
- Current version: `0.4.2`
1653
+ Current version: `0.5.1`
1528
1654
 
1529
1655
  ## Author
1530
1656
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module B4umGenerators
4
- VERSION = "0.4.2"
4
+ VERSION = "0.5.1"
5
5
  end
@@ -1172,6 +1172,95 @@ module B4um
1172
1172
  - Safe repeated generator runs
1173
1173
 
1174
1174
 
1175
+ TODO
1176
+
1177
+ bin/rails generate b4um:todo MODEL
1178
+
1179
+ Generates a complete Todo application for Rails.
1180
+
1181
+ Example:
1182
+
1183
+ bin/rails generate b4um:todo Task
1184
+ bin/rails db:migrate
1185
+
1186
+ By default, the Todo list is shared across the application.
1187
+ Tasks are not assigned to individual users.
1188
+
1189
+ To create personal Todo lists, use --owner:
1190
+
1191
+ bin/rails generate b4um:todo Task --owner=User
1192
+ bin/rails db:migrate
1193
+
1194
+ The owner model must already exist.
1195
+
1196
+ For user-specific Todo lists, b4um authentication can be
1197
+ installed first:
1198
+
1199
+ bin/rails generate b4um:scaffold User name:string email:string password_digest:string
1200
+ bin/rails db:migrate
1201
+ bin/rails generate b4um:authentication User
1202
+ bin/rails generate b4um:todo Task --owner=User
1203
+ bin/rails db:migrate
1204
+
1205
+ The owner option supports other authentication models:
1206
+
1207
+ --owner=User
1208
+ --owner=Member
1209
+ --owner=Customer
1210
+
1211
+ The generated controller uses the corresponding
1212
+ current owner helper, for example:
1213
+
1214
+ current_user
1215
+ current_member
1216
+ current_customer
1217
+
1218
+ With an owner, each account has its own Todo list.
1219
+
1220
+ Tasks are loaded through the current owner's association.
1221
+ Users cannot access tasks belonging to another account.
1222
+
1223
+ Unauthenticated requests to owner-specific Todo actions
1224
+ receive HTTP 401 Unauthorized.
1225
+
1226
+ Todo features:
1227
+
1228
+ - Create new tasks
1229
+ - Mark tasks as completed
1230
+ - Reopen completed tasks
1231
+ - Delete tasks
1232
+ - Separate lists for open and completed tasks
1233
+ - Automatic task counters
1234
+ - Progress bar with completion percentage
1235
+ - Turbo Stream updates without full page reloads
1236
+ - Stimulus controller for the task input
1237
+ - Automatic input reset after successful creation
1238
+ - b4um floating labels
1239
+ - Responsive b4um card layout
1240
+ - Light and dark mode support
1241
+ - Optional owner association with --owner
1242
+ - Owner-specific task access protection
1243
+
1244
+ The generator creates:
1245
+
1246
+ - Task model and database migration
1247
+ - Tasks controller
1248
+ - Resource routes
1249
+ - Index view
1250
+ - Task partial
1251
+ - Progress partial
1252
+ - Todo stylesheet
1253
+ - Stimulus controller
1254
+
1255
+ After generating the Todo application, run:
1256
+
1257
+ bin/rails db:migrate
1258
+
1259
+ With the default Task model, the Todo list is available at:
1260
+
1261
+ /tasks
1262
+
1263
+
1175
1264
  COMMENTS
1176
1265
 
1177
1266
  bin/rails generate b4um:comments MODEL
@@ -66,6 +66,21 @@
66
66
  --b4um-hero-teaser-background: rgba(255, 255, 255, 0.55);
67
67
  --b4um-hero-teaser-text: rgba(20, 20, 20, 0.9);
68
68
  --b4um-hero-teaser-border: rgba(255, 255, 255, 0.3);
69
+
70
+ /* todo */
71
+ --todo-primary: var(--b4um-primary);
72
+
73
+ --todo-primary-hover: var(--b4um-primary-hover);
74
+
75
+ --todo-background: #ffffff;
76
+ --todo-surface: #f7f9fb;
77
+ --todo-border: #e5e9ee;
78
+
79
+ --todo-text: #20252b;
80
+ --todo-muted: #737d89;
81
+
82
+ --todo-success: #22a06b;
83
+ --todo-danger: #d94b4b;
69
84
  }
70
85
 
71
86
  /* -------------------------------------------------------
@@ -136,5 +151,13 @@
136
151
  --b4um-hero-teaser-text: rgba(255, 255, 255, 0.85);
137
152
  --b4um-hero-teaser-border: rgba(255, 255, 255, 0.18);
138
153
 
154
+ /* todo */
155
+ --todo-background: #28292a;
156
+ --todo-surface: #222426;
157
+ --todo-border: #414448;
158
+
159
+ --todo-text: #e3e3e3;
160
+ --todo-muted: #a2a8ae;
161
+
139
162
  color-scheme: dark;
140
163
  }
@@ -0,0 +1,22 @@
1
+ <section id="todo_progress" class="b4um-todo__progress">
2
+ <div class="b4um-todo__progress-info">
3
+ <h2>Fortschritt</h2>
4
+
5
+ <span>
6
+ <%%= @completed_tasks %> von <%%= @total_tasks %> erledigt
7
+ </span>
8
+ </div>
9
+
10
+ <%% progress = @total_tasks.positive? ? (@completed_tasks * 100.0 / @total_tasks).round : 0 %>
11
+
12
+ <div class="b4um-todo__progress-bar">
13
+ <div
14
+ class="b4um-todo__progress-fill"
15
+ style="width: <%%= progress %>%"
16
+ ></div>
17
+ </div>
18
+
19
+ <p class="b4um-todo__progress-percentage">
20
+ <%%= progress %>% abgeschlossen
21
+ </p>
22
+ </section>
@@ -0,0 +1,42 @@
1
+ <div id="<%%= dom_id(task) %>"
2
+ class="b4um-todo__item <%%= 'b4um-todo__item--complete' if task.complete? %>">
3
+
4
+ <div class="b4um-todo__item-content">
5
+
6
+ <%%= button_to <%= singular_table_name %>_path(task),
7
+ method: :patch,
8
+ class: "b4um-todo__checkbox",
9
+ form: { data: { turbo: true } },
10
+ aria: {
11
+ label: task.complete? ? "Als offen markieren" : "Als erledigt markieren",
12
+ pressed: task.complete?
13
+ } do %>
14
+
15
+ <span class="b4um-todo__checkbox-icon">
16
+ <%%= "✓" if task.complete? %>
17
+ </span>
18
+
19
+ <%% end %>
20
+
21
+ <span class="b4um-todo__item-name">
22
+ <%%= task.name %>
23
+ </span>
24
+
25
+ </div>
26
+
27
+ <%%= button_to <%= singular_table_name %>_path(task),
28
+ method: :delete,
29
+ class: "b4um-todo__delete",
30
+ form: {
31
+ data: {
32
+ turbo: true,
33
+ turbo_confirm: "Möchtest du diese Aufgabe wirklich löschen?"
34
+ }
35
+ },
36
+ aria: { label: "Aufgabe löschen" } do %>
37
+
38
+ <span aria-hidden="true">×</span>
39
+
40
+ <%% end %>
41
+
42
+ </div>
@@ -0,0 +1,13 @@
1
+ class Create<%= class_name.pluralize %> < ActiveRecord::Migration[<%= migration_version %>]
2
+ def change
3
+ create_table :<%= plural_table_name %> do |t|
4
+ t.string :name, null: false
5
+ t.boolean :complete, default: false, null: false
6
+ <% if owner? %>
7
+ t.references :<%= owner_reference_name %>, null: false, foreign_key: true
8
+ <% end %>
9
+
10
+ t.timestamps
11
+ end
12
+ end
13
+ end