From c60f2c419257f3ae9d7d372bfd1f9aee96ea691e Mon Sep 17 00:00:00 2001 From: dlage Date: Sun, 5 Apr 2015 18:49:59 +0100 Subject: [PATCH] Update README.md --- README.md | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 36a4450..28849db 100644 --- a/README.md +++ b/README.md @@ -30,15 +30,23 @@ Example usage: In your base mojo class: ```perl - my $assets = File::Assets::Precompile->new( - 'base_path' => $self->home . '/assets/', - 'output_path' => $self->home . '/public/assets/', - 'base_url' => '/assets/', - 'development_mode' => 1, - ); - $assets->copy_files(); - $self->helper( - 'asset_url' => sub { my $self = shift; $assets->asset_url(@_); }, ); +my $assets = File::Assets::Precompile->new( + 'base_path' => $self->home . '/assets/', + 'output_path' => $self->home . '/public/assets/', + 'base_url' => '/assets/', + 'development_mode' => 1, +); +$assets->copy_files(); +$self->helper( + 'asset_url' => sub { + my $self = shift; + $assets->asset_url(@_); + }, +); +``` +Then, in you templates: +```perl +<%= link_to 'my versioned asset' => asset_url('bootstrap-3.3.4-dist/js/bootstrap.js') %> ``` ##SUPPORT AND DOCUMENTATION