Basic feature implemented, very basic poc

This commit is contained in:
David Schärer 2024-07-16 20:22:59 +02:00
parent 216089a3e7
commit 48c0067076
118 changed files with 2113 additions and 20 deletions

View file

@ -0,0 +1,25 @@
<h1><%%= t("scaffold.pagetitle_index", model: <%= class_name %>.model_name.human(count: 2)) %></h1>
<table class="table table-striped">
<thead>
<tr>
<th><%%= <%= class_name %>.human_attribute_name(:id) %></th>
<% attributes.each do |attribute| %>
<th><%%= <%= class_name %>.human_attribute_name(:<%= attribute.column_name %>) %></th>
<% end %>
</thead>
<tbody>
<%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %>
<tr>
<td><%%= link_to(<%= singular_table_name %>.id, url_for(<%= singular_table_name %>)) %></td>
<% attributes.each do |attribute| %>
<td><%%= link_to(<%= singular_table_name %>.<%= attribute.column_name %>, url_for(<%= singular_table_name %>)) %></td>
<% end %>
</tr>
<%% end %>
</tbody>
</table>
<div class="action-row">
<%%= link_to t("scaffold.link_new", model: <%= class_name %>.model_name.human), new_<%= singular_table_name %>_path %>
</div>