Application is going to the wrong route

Okay so I have a factory that instantiates my model and service classes. I am also rendering views. My application is a simple crud application. I am getting a url error.

This is my href.

href="/detail/Beer/{{beer.id}}

THIS is my route for my view

$app->get(
’/detail/:class/:id’,
function ($class, $id) use ($app, $log){
if(!$log->isUserLoggedIn()){
$app->redirect(’/login’);
}else {

        if($class == "Beer"){
            $app->render('beer/beer.php', array('beer_id' => $id));
        }
        if($class == "Brewery"){
            $app->render('brewery/brewery.php', array('brewery_id' => $id));
        }
        if($class == "Type"){
            $app->render('add-type-view.php');
        }
    }
}

);

I am getting this error:
Fatal error: Uncaught Error: Class ‘detail’ not found in /Users/McDavis/Documents/repos/tap-room-web-tool/domain/Factory/Factory.php:36
Stack trace:
0 /Users/McDavis/Documents/repos/tap-room-web-tool/index.php(244): Factory->getModel(‘detail’)
1 [internal function]: {closure}(‘detail’, ‘app.js’)
2 /Users/McDavis/Documents/repos/tap-room-web-tool/Slim/Route.php(468): call_user_func_array(Object(Closure), Array)
3 /Users/McDavis/Documents/repos/tap-room-web-tool/Slim/Slim.php(1357): Slim\Route->dispatch()
4 /Users/McDavis/Documents/repos/tap-room-web-tool/Slim/Middleware/Flash.php(85): Slim\Slim->call()
5 /Users/McDavis/Documents/repos/tap-room-web-tool/Slim/Middleware/MethodOverride.php(92): Slim\Middleware\Flash->call()
6 /Users/McDavis/Documents/repos/tap-room-web-tool/Slim/Middleware/PrettyExceptions.php(67): Slim\Middleware\MethodOverride->call()
7 /Users/McDavis/Documents/repos/tap-room-web-tool/Slim/Slim.php(1302): Slim\Middleware\PrettyExceptions->call()
8 /Users/McDavis/Documents/repos/tap-room-web-tool/in in /Users/McDavis/Documents/repos/tap-room-web-tool/domain/Factory/Factory.php on line 36

This is the route it is entering on line 244:

$app->get(’/:class/:id’, function ($class, $id) use ($factory){
$obj = $factory->getModel($class);
$svc = $factory->getService($obj);
echo json_encode($svc->get($id));
}
);

So I do not know why it is entering this route.

I am using SLIM 2.7 I believe.

The version is 2.6.2 actually

how about the .htaccess file ? the .htaccess file need to place in same location with index.php

This is my .htaccess. It is in the same directory as the index.php file

RewriteEngine On

Some hosts may require you to use the RewriteBase directive.
If you need to use the RewriteBase directive, it should be the
absolute physical path to the directory that contains this htaccess file.

RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]