diff --git a/STYLE.md b/STYLE.md index 498a8e720..196551ba6 100644 --- a/STYLE.md +++ b/STYLE.md @@ -135,6 +135,22 @@ class SomeModule end ``` +## CRUD controllers + +We model web endpoints as CRUD operations on resources (REST). When an action doesn't map cleanly to a standard CRUD verb, we introduce a new resource rather than adding custom actions. + +```ruby +# Bad +resources :cards do + post :close + post :reopen +end + +# Good +resources :cards do + resource :closure +end +``` ## Controller and model interactions