def call(env)
      params = env[ActionDispatch::Http::Parameters::PARAMETERS_KEY]
      controller = find_controller_by params
      controller.action(params[:action]).call env
    rescue ::AbstractController::ActionNotFound, ModelNotFound => e
      set_message_for e, env
      default_controller(params).action(:not_found).call env
    rescue UnprocessableEntity => e
      set_message_for e, env
      default_controller(params).action(:unprocessable_entity).call env
    end
def call(env)
      params = env[ActionDispatch::Http::Parameters::PARAMETERS_KEY]
      controller = find_controller_by params
      controller.action(params[:action]).call env
    rescue ::AbstractController::ActionNotFound, ModelNotFound => e
      set_message_for e, env
      default_controller(params).action(:not_found).call env
    rescue UnprocessableEntity => e
      set_message_for e, env
      default_controller(params).action(:unprocessable_entity).call env
    end
@see http://edgeguides.rubyonrails.org/routing.html#routing-to-rack-applications
 It tries to find out the controller that has the same model class from converted resources name.
 Otherwise, it falls back to base resources controller which will come from the following sources:

 1. `:resources_controller` parameter
 2. resources_controller mapping configuration,
   e.g. `Admin::ApplicationController` if defined or `Wallaby::ResourcesController`
 @param env [Hash] @see http://www.rubydoc.info/github/rack/rack/master/file/SPEC