Howto make a button to create new record
The high level process is:
- Choose an attribute to anchor the link
- Add :link/class :hf/new
- Add a new :link/fiddle to the link to model the form
1. Choose an attribute to anchor the link
Is this entity identifiable by an attribute?
- If so, use that attribute to anchor the link.
- Works for attrs that are :db.type/ref or :db.unique/identity
- Example: :dustingetz.post/slug
- Warning: Don't choose :db/id or :db/ident, they are too general and the link will appear in too many places.
Is this entity coming from a top-level Datomic query?
- If so, use the query's fiddle/ident to anchor the link.
2. Add :link/class :hf/new
This will turn the anchor into a button.
- This button doesn't do anything yet! That is what
3. Add a new :link/fiddle to model the form
Alt-clickinside the popover to drill down into the popover's form's fiddle (opens in new tab)
- Fill out a pull expression for this form