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.

order of possible_controllers

#938

If there are two controllers, like

  • MConrtoller(app/controllers/m_controller.rb)
  • M::CController(app/controllers/m/c_controller.rb)

request against "/m/c" will be recognized differently depends on the entry order of directory "m" and file "m_controller.rb" on "app/controllers", likes %x(ls -f).

If Dir["app/controllers/*/_controller.rb"] returns ["app/controllers/m_controller.rb", "app/controllers/m/c_controller.rb"], "/m/c" goes to {"controller" => "m", "action" => "c"}, vice versa, "/m/c" goes to {"controller" => "m/c", "action" => "index"}.

This is ambiguous, and it should be recognized as modulized one (as "m/c"), I guess. ActionController::Routing.possible_controllers should sort @possible_controllers appropriately.

Reported by Nobuhiro IMAI · August 30th, 2008 @ 04:25 AM

State: stale
Milestone: 3.x
Assigned to: nobody
Importance: none

Activity

  1. Pratik
    Pratik
    • State changed from new to incomplete

    Missing tests.

    August 30th, 2008 @ 04:52 PM

  2. Nobuhiro IMAI
    Nobuhiro IMAI

    I updated a patch adding assertion to check whether "admin/user" is always preferred to "user".

    This assertion is nonsense if the entry order of actionpack/test/controller/controller_fixtures/ is:

    • admin/
    • user_controller.rb

    but, some environments may have above entries in reverse order.

    August 31st, 2008 @ 02:06 PM

  3. Nobuhiro IMAI
    Nobuhiro IMAI

    Oops, it was wrong. Situation in question is:

    • admin/
    • admin_controller.rb

    so, attached new patch.

    August 31st, 2008 @ 05:36 PM

  4. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.x to 3.x

    May 4th, 2010 @ 06:48 PM

  5. Santiago Pastorino
    Santiago Pastorino
    • State changed from incomplete to open
    • Importance changed from to

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

    February 2nd, 2011 @ 05:05 PM

  6. Santiago Pastorino
    Santiago Pastorino
    • State changed from open to stale

    February 2nd, 2011 @ 05:05 PM