Flowdock
method

controller_class_for

Importance_0
v6.1.3.1 - Show latest stable - 0 notes - Class: ActionDispatch::Request
controller_class_for(name) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File actionpack/lib/action_dispatch/http/request.rb, line 88
    def controller_class_for(name)
      if name
        controller_param = name.underscore
        const_name = controller_param.camelize << "Controller"
        begin
          ActiveSupport::Dependencies.constantize(const_name)
        rescue NameError => error
          if error.missing_name == const_name || const_name.start_with?("#{error.missing_name}::")
            raise MissingController.new(error.message, error.name)
          else
            raise
          end
        end
      else
        PASS_NOT_FOUND
      end
    end
Register or log in to add new notes.