#!/usr/bin/env perl

use Dancer;
use Dancer::Plugin::DBIC;
#use Dancer::Plugin::DBIC qw(schema); # explicit import if you like

get '/profile/:id' => sub {
    my $user = schema->resultset('Users')->find(params->{id});
    # or explicitly ask for a schema by name:
    $user = schema('foo')->resultset('Users')->find(params->{id});
    template user_profile => { user => $user };
};

dance;

# Dancer Configuration File

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