X-Git-Url: https://git.r.bdr.sh/rbdr/grita/blobdiff_plain/5573b3c2672a04d58a91ce1c74f9c543e14fb423..refs/heads/main:/views/index.haml?ds=sidebyside diff --git a/views/index.haml b/views/index.haml index 742418d..7801311 100644 --- a/views/index.haml +++ b/views/index.haml @@ -1,8 +1,27 @@ %form{:method => 'post', :action => '/'} + -unless @grito.nil? + -unless @grito.errors.empty? + #errors + -@grito.errors.each do |e| + %span= e + %br + -else + #success + Su texto ha sido guardado! + %a{:href=>"/#{@grito.gethash}"} De click aquí para verlo. %h1 Título - %input{:type => 'text', :name => 'title', :class => 'title'} + -unless @grito.nil? + -unless @grito.errors.empty? + %input.title{:type => 'text', :name => 'title', :Value => @grito.title} + -else + %input.title{:type => 'text', :name => 'title'} + -else + %input.title{:type => 'text', :name => 'title'} %br %h1 Texto - %textarea{:name => 'text', :class => 'text', :cols => '100'} + %textarea.text{:name => 'text', :cols => '76', :rows => '20'} + -unless @grito.nil? + -unless @grito.errors.empty? + =@grito.text %br - %input{:type => 'submit', :value => 'Gritalo!'} \ No newline at end of file + %input.submit{:type => 'submit', :value => 'Gritalo!'} \ No newline at end of file