% layout 'default';
% title 'Imgbin -- Create';
% stash 'styles' => 'zerobin';
% my %times = (day => 1, week => 7, month => 30, quarter => 90, year => 395);
% my @times = map { [l($_) => $times{$_}] } sort { $times{$a} <=> $times{$b} } keys(%times);
Загрузить файл
<%= form_for "/imgbin" => (method => 'POST', enctype => 'multipart/form-data') => begin %>
<%= submit_button l('Upload') %>
<%= tag 'label' => (for => 'expire') => l('Keep for') %>:
<%= select_field 'expire' => \@times %>
<%= file_field 'file', required => 1 %>
<% end %>
% if (my $error = flash 'error') {
<%= l(ucfirst($error)) %>
% }