rails-antipattern-homemade-keys-and-routes

Installation
SKILL.md

Antipattern: Homemade Keys and Routes

The smell

  • Hand-rolled get "show_post/:slug", to: "posts#show_by_slug" style routes
  • Custom controller methods named show_by_slug, user_posts, do_publish
  • link_to "...", "/show_post/#{p.slug}" (string URLs) because no helper exists
  • Resourceful concepts wearing custom URLs

Why it hurts

  • No path/url helpers from resources — every link is bespoke
  • redirect_to @post doesn't work
  • Polymorphic helpers (form_with model: @post) break
  • Authorization scoping (current_user.posts.find(params[:id])) becomes harder
  • New devs can't predict URLs from models
Installs
2
First Seen
May 8, 2026
rails-antipattern-homemade-keys-and-routes — gierd-inc/dev-skills