% layout 'default'; % title 'Zerobin -- View'; % my %times = (day => 1, week => 7, month => 30, quarter => 90, year => 395); % my @times = map { [l($_) => $times{$_}] } sort { $times{$a} <=> $times{$b} } keys(%times); % param 'expire' => 30; % my $syntax = (stash 'syntax') || []; % param 'syntax' => ''; % my %opts = (id => 'paste', name => 'paste');

Создать запись

<%= form_for "/zerobin" => (method => 'POST', enctype => "multipart/form-data") => begin %>
<%= tag 'label' => (for => 'expire') => l('Keep for') %>: <%= select_field 'expire' => \@times %>  <%= tag 'label' => (for => 'syntax') => l('Format') %>: <%= select_field 'syntax' => $syntax %>

Копипаст ↓↓↓ или файл → 

<%= tag 'textarea' => (placeholder => l('Paste your text here'), %opts) => '' %>

<%= submit_button l('Save') %>

<% end %>
% my $result = (flash 'result') || ''; % if ($result) {

<%= l(ucfirst($result)) %>

% }