The route maker's job is basically two things:
- Make sure that all controllers includes the right mixins
- If any controllers doesn't respond to "urls" (aka. haven't been inherited
  from R) define "urls" as ClassName.downcase

The first point can be accomplished within R, but not the latter. But it
should be noted that the latter also can cause some troubles. It's assuming
all constants under Controllers are class and all should be publicly

module Camping::Controllers
  LIMIT = 6
  # Ops! Crashing time!

  class HiddenStuff;end
  # Ops! Hacking time!

By removing the route maker you must explicitly define controllers by
inherited it from R:

module Camping::Controllers
  class Posts
  # No longer working!
  # Stick with this:
  class Posts < R '/posts'

What do you think? (It's also 135 bytes smaller). Code available here:

Magnus Holm
Camping-list mailing list

Reply via email to