Skip to content
gangelo edited this page Oct 18, 2025 · 2 revisions

Welcome to the simple_command_dispatcher Wiki!

simple_command_dispatcher (SCD) is a lightweight Ruby gem that enables Rails applications to dynamically execute command objects using convention over configuration. It automatically transforms request paths into Ruby class constants, allowing controllers to dispatch commands based on routes and parameters.

Quick Links

Getting Started

Building Commands

Advanced Topics

Real-World Examples

Reference

Why simple_command_dispatcher?

The Problem

Controllers get bloated with business logic. Service objects help, but you still need boilerplate routing code.

The Solution

SCD automatically maps request paths to commands—zero configuration needed:

# Your request:
POST /api/v1/mechs/search

# SCD automatically calls:
Api::V1::Mechs::Search.call(params)

No routing tables. No switch statements. No manual mapping. Just convention.

Key Benefits

Convention Over Configuration - Paths automatically map to commands ✅ Built-in Success/Failure Tracking - Know instantly if your command worked ✅ Dynamic Dispatching - One controller action handles multiple commands ✅ Smart Parameter Handling - Works with Hash, Array, or single values ✅ Lightweight - Only one dependency (ActiveSupport) ✅ Fast - Uses Rails' proven camelization under the hood

Demo Application

See SCD in action with the demo application - a complete Rails API app with tests demonstrating real-world usage.

Getting Help

Contributing

Bug reports and pull requests are welcome on GitHub. This project is intended to be a safe, welcoming space for collaboration.

License

The gem is available as open source under the terms of the MIT License.

Clone this wiki locally