summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/index.haml14
-rw-r--r--views/layout.haml8
2 files changed, 22 insertions, 0 deletions
diff --git a/views/index.haml b/views/index.haml
new file mode 100644
index 0000000..51e4781
--- /dev/null
+++ b/views/index.haml
@@ -0,0 +1,14 @@
+%h1 Sinatra File Upload
+
+- if @flash
+ = @flash
+
+%form{:action => '/upload', :method => 'post', :enctype => 'multipart/form-data'}
+ %p<
+ %input{:type => 'file', :name => 'file'}
+ %p<
+ %input{:type => 'submit', :value => 'Upload'}
+
+%h3 Files
+- @files.each do |file|
+ = "<a href='files/#{file}'>#{file}</a>"
diff --git a/views/layout.haml b/views/layout.haml
new file mode 100644
index 0000000..1e37026
--- /dev/null
+++ b/views/layout.haml
@@ -0,0 +1,8 @@
+!!!
+%html{:xmlns => 'http://www.w3.org/1999/xhtml'}
+ %head
+ %title Sinatra File Upload
+ %link{:rel => 'stylesheet', :type => 'text/css', :href => 'css/style.css'}
+ %meta{:content => 'text/html; charset=utf-8', :'http-equiv' => 'Content-Type'}
+ %body
+ = yield