static public Method

Routing.possible_controllers

There's no documentation for this item.

Source Code

# File action_controller/routing.rb, line 284
def possible_controllers
  unless @possible_controllers
    @possible_controllers = []

    paths = controller_paths.select { |path| File.directory?(path) && path != "." }

    seen_paths = Hash.new {|h, k| h[k] = true; false}
    normalize_paths(paths).each do |load_path|
      Dir["#{load_path}/**/*_controller.rb"].collect do |path|
        next if seen_paths[path.gsub(%r{^\.[/\\]}, "")]

        controller_name = path[(load_path.length + 1)..-1]

        controller_name.gsub!(/_controller\.rb\Z/, '')
        @possible_controllers << controller_name
      end
    end

    # remove duplicates
    @possible_controllers.uniq!
  end
  @possible_controllers
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.