rails-37-style-core-rails-routing

Enforce RESTful routing with resource-based patterns in Rails applications.

Updated Mar 6, 2026
One-click install
npx skills add https://github.com/Chwistophe/agent-skills-unofficial-37-signals-rails-way-fizzy --skill rails-37-style-core-rails-routing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rails-37-style-core-rails-routing
Source: https://github.com/Chwistophe/agent-skills-unofficial-37-signals-rails-way-fizzy/tree/main/rails-37-style-core-rails-routing
Command: npx skills add https://github.com/Chwistophe/agent-skills-unofficial-37-signals-rails-way-fizzy --skill rails-37-style-core-rails-routing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a clear, opinionated approach to Rails routing, ensuring that your application's URLs are RESTful, predictable, and easy to manage, aligning with the 37signals philosophy.

Core Features & Use Cases

  • Resource-Based Routing: Emphasizes using standard RESTful resources and CRUD verbs.
  • Custom Actions as Resources: Transforms non-CRUD actions into dedicated resources (e.g., resource :closure instead of post :close).
  • Shallow Nesting: Simplifies nested routes to prevent overly long URL paths.
  • Singular Resources: Correctly uses resource for one-to-one relationships.
  • Module Scoping & Namespacing: Organizes controllers logically without affecting URLs.
  • resolve Helper: Enables correct polymorphic URL generation for nested resources.
  • API Design: Advocates for using the same controllers for HTML and JSON responses via respond_to.

Quick Start

Configure your Rails routes to use resource-based patterns and shallow nesting for better organization.

Frequently Asked Questions about rails-37-style-core-rails-routing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I map custom non-CRUD actions to RESTful resources in Rails routing?

To map custom non-CRUD actions in Rails routing, transform them into dedicated resources using `resource :closure` instead of member routes like `post :close`, ensuring URLs remain predictable and align with RESTful principles.

What is the best way to simplify deeply nested Rails routes?

The best way to simplify deeply nested Rails routes is shallow nesting, which prevents overly long URL paths by only applying the parent prefix to collection actions and keeping member actions flat.

How does the resolve helper work for polymorphic URL generation in Rails?

The `resolve` helper in Rails routing works by enabling correct polymorphic URL generation for nested resources, allowing `url_for` and link helpers to dynamically build paths based on object associations.

Can I use the same Rails controllers for both HTML and API JSON responses?

Yes, you can use the same Rails controllers for both HTML and API JSON responses by utilizing the `respond_to` block, promoting a unified controller approach that serves multiple formats cleanly.

When should I use singular resources instead of standard resources in Rails?

You should use singular resources in Rails for one-to-one relationships where the resource does not require an ID in the URL, correctly mapping to a single resource instance rather than a collection.

How do I organize Rails controllers with module scoping without affecting URLs?

To organize Rails controllers without affecting URLs, use module scoping and namespacing in your routing configuration, grouping controllers logically in directories while maintaining clean, root-level URL paths.