Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

[PULLREQUEST] add support for specifying a file to load routes from in environment.rb

#88

http://github.com/nullstyle/rail...

This commit adds in the ability to specify a routes_configuration_file in your Rails configuration, which will be used in place of config/routes.rb

Reported by Scott Fleckenstein · May 1st, 2008 @ 09:38 PM

State: resolved
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. DHH
    DHH

    What is the use case for this feature?

    Also, please always attach the patch to the ticket. We don't use pullrequest for one-offs (it's a hassle).

    May 1st, 2008 @ 10:29 PM

  2. Scott Fleckenstein
    Scott Fleckenstein

    The use case is when I have an 2 separated front-ends that rely on the same models, supporting library code, and plugins.

    For example: getsatisfaction.com and api.getsatisfaction.com share models but not controllers/helpers/views. getsatisfaction.com goes away from rails conventions for improved SEO, while api adheres. At present, I selectively load which routes are needed in routes.rb itself, but it makes me feel gross. It's much nicer to simply set the appropriate routes file in the environment files used by the "api" or "app" configurations.

    Also, IMO, it improves the readability of the methods in routeset.rb by removing some repeated invocations of "#{RAILS_ROOT}/config/routes.rb", but i'm not sure if you care about that :).

    Sorry about the pull request, I wasn't sure about the etiquette.

    Patch is now attached.

    May 1st, 2008 @ 10:41 PM

  3. Repository
    Repository
    • State changed from new to resolved

    (from [926f4648f0628009336c44f4d31019819434e39c]) Made the location of the routes file configurable with config.routes_configuration_file (Scott Fleckenstein) [#88 state:resolved]

    http://github.com/rails/rails/co...

    May 1st, 2008 @ 11:27 PM