Scope
Use this skill for search/filter/list pages backed by query params.
Checklist
- •Add an embedded ViewModel in
lib/app/view_model/*usinguse App, :view_model. - •Define
embedded_schemafields for filters, and avalidate/1function that returns{ :ok, options, changeset }. - •Build filtered queries using
scope/2functions andRepo.paginate/2(Scrivener). - •In the LiveView, call
validate/1inhandle_params/3, assign@formviato_form(changeset, as: "form"). - •Use
push_patchto keep filters in the URL and ensure invalid params raiseWeb.Status.NotFound.