You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rails famously used scaffolding for Model CRUD (Create, Read, Update and Delete). There is no scaffolding in Hyperstack today, so here is an example which demonstrates how those simple Rails pages would work in Hyperstack.
1436
+
1437
+
This examples uses components from the [Material UI](https://material-ui.com/) framework but the principals would be similar for any framework (or just HTML elements).
1438
+
1439
+
In this example, we will have a table of users and the ability to add new users or edit a user from the list.
1440
+
1441
+
Firstly the table of users:
1442
+
1443
+
```ruby
1444
+
classUserIndex < HyperComponent
1445
+
render(DIV, class: 'mo-page') do
1446
+
UserDialog(user:User.new) # this will render as a button to add users
1447
+
Tabledo
1448
+
TableHeaddo
1449
+
TableRowdo
1450
+
TableCell { 'Name' }
1451
+
TableCell { 'Gender' }
1452
+
TableCell { 'Edit' }
1453
+
end
1454
+
end
1455
+
TableBodydo
1456
+
user_rows
1457
+
end
1458
+
end
1459
+
end
1460
+
1461
+
defuser_rows
1462
+
User.each do |user| # note User is a Hyperstack model (see later in the Isomorphic section)
0 commit comments