This project is archived and is in readonly mode.

#938 ✓stale
Nobuhiro IMAI

order of possible_controllers

Reported by Nobuhiro IMAI | August 30th, 2008 @ 04:25 AM | in 3.x

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.

Comments and changes to this ticket

  • Pratik

    Pratik August 30th, 2008 @ 04:52 PM

    • State changed from “new” to “incomplete”

    Missing tests.

  • Nobuhiro IMAI

    Nobuhiro IMAI August 31st, 2008 @ 02:06 PM

    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.

  • Nobuhiro IMAI

    Nobuhiro IMAI August 31st, 2008 @ 05:36 PM

    Oops, it was wrong. Situation in question is:

    • admin/
    • admin_controller.rb

    so, attached new patch.

  • Jeremy Kemper

    Jeremy Kemper May 4th, 2010 @ 06:48 PM

    • Milestone changed from 2.x to 3.x
  • Santiago Pastorino

    Santiago Pastorino February 2nd, 2011 @ 05:05 PM

    • 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.

  • Santiago Pastorino

    Santiago Pastorino February 2nd, 2011 @ 05:05 PM

    • State changed from “open” to “stale”

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>

People watching this ticket