Cookbook / Data and forms
Create a resource.
Generate a book catalog, then make the model, actions, views, and request specs your own.
Draft recipeTarget: 0.6.1Not yet recipe-tested
Where the change goes
app/models/book.crThe stored shapeapp/changesets/book.crRules for writesapp/actions/books/Request handlingapp/views/books/Browser presentationspec/requests/books_spec.crBehavior checksGenerate the feature
Run inside a configured application. Review the generated files and migration before applying it.
frappe make resource Book title:string author:string
frappe migrateChoose the generated surface
original_url:string:url adds URL validation, a URL input, and valid request-spec samples. Use --only=create,show for a smaller resource; create and show are required, and edit needs new and update. Use :server for fields set by the action and :unique for a unique index and constraint checks.
Prove the behavior
frappe check
frappe corretto spec/requests/books_spec.crThe generated request spec exercises create, read, update, delete, and rejection of invalid requests. Extend it with your own validation rule and an example that fails that rule.