Skip to content

Instantly share code, notes, and snippets.

@sanyacomua
Created November 18, 2013 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sanyacomua/7528031 to your computer and use it in GitHub Desktop.
Save sanyacomua/7528031 to your computer and use it in GitHub Desktop.
Result: on every form submit we losing one leading empty line in textarea. Expected: content of textarea stays unchanged.
#!/usr/bin/env perl
use Mojolicious::Lite;
any '/' => sub {
my $self = shift;
$self->render('index');
};
app->start;
__DATA__
@@ index.html.ep
% layout 'default';
% title 'Welcome';
%= form_for '' => (method => 'POST') => begin
%= text_area 'txt' => (rows => 10, cols => 50) => begin
not_empty_line
% end
<br>
%= submit_button
% end
@@ layouts/default.html.ep
<!DOCTYPE html>
<html>
<head><title><%= title %></title></head>
<body><%= content %></body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment