Pre-built components shipped with Compony
Compony comes with a few pre-built components that cover the most common cases that can be speed up development. They are meant to be inherited from and the easiest way to do this is by using the provided Rails generators rails g component ....
The pre-built components can be found in the module Compony::Components. They ship a
sensible, UI-agnostic default (plain HTML, no styling) — you typically inherit from them
in an app base layer that adds your UI framework's markup (see
Real-world patterns). Show and Index
are intentionally minimal because their presentation depends heavily on your UI framework;
they are easy to override (see the example).
In the following, the pre-built components currently shipped with Compony are presented:
- Show: Compony's equivalent to Rail's
showcontroller action - Index: Compony's equivalent to Rail's
indexcontroller action - List: Compony's equivalent to Rail's
_listpartial - Destroy: Compony's equivalent to Rail's
destroycontroller action - WithForm: A base class for components containing and submitting forms
- Form: Compony's equivalent to Rail's
_formpartial - New: Compony's equivalent to Rail's
newandcreatecontroller action - Edit: Compony's equivalent to Rail's
editandupdatecontroller action