Skip to content

Files

Latest commit

 

History

History
34 lines (24 loc) · 737 Bytes

Rails-ActionOrder.md

File metadata and controls

34 lines (24 loc) · 737 Bytes

Pattern: Wrong Rails controller action order

Issue: -

Description

Enforces consistent ordering of the standard Rails RESTful controller actions.

The rule is configurable and can enforce any ordering of the standard actions. All other methods are ignored.

Examples

# bad
def index; end
def destroy; end
def show; end

# good
def index; end
def show; end
def destroy; end

Configurable attributes

Name Default value Configurable values
ExpectedOrder index, show, new, edit, create, update, destroy Array
Include +app/controllers/**/*.rb+ Array

Further Reading