#!/usr/bin/env perl

use Dancer;
use Dancer::Plugin::DBIC;

get '/profile/:id' => sub {
    my $users_rs = foo->resultset('Users')->search({
        user_id => params->{id}
    });
    
    template 'user_profile', { user => $user_rs->next };
};

dance;

# Dancer Configuration File

plugins:
  DBIC:
    foo:
      dsn:  "dbi:mysql:db_foo"
      user: "root"
      pass: "****"
      pckg: "Foo::Bar"
      options:
        RaiseError: 1
        PrintError: 1