Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated and working!

  • Loading branch information...
commit 756b8e5de9dba3bbb0e0cbfd909aabe8529a6a33 1 parent 8413451
Blake Mizerany authored
Showing with 7 additions and 6 deletions.
  1. +3 −3 examples/hello/hello.rb
  2. +4 −3 examples/todo/todo.rb
View
6 examples/hello/hello.rb
@@ -24,7 +24,7 @@
# Custom 404
-get 404 do
- 'Custom 404!!!!'
-end
+# get 404 do
+# 'Custom 404!!!!'
+# end
View
7 examples/todo/todo.rb
@@ -11,8 +11,8 @@
%li.item
%div
= item
- %form{:action => "/", :method => 'POST'}
- %input{:type => 'hidden', :name => '_method', :value => 'index'}
+ %form{:action => "/" + index.to_s, :method => 'POST'}
+ %input{:type => 'hidden', :name => '_method', :value => 'DELETE'}
%input{:type => 'submit', :value => 'delete'}
%form{:action => '/clear', :method => 'POST'}
%input{:value => 'clear', :type => :submit}
@@ -33,5 +33,6 @@
end
delete '/:id' do
-
+ session[:items].delete_at(params[:id].to_i)
+ redirect '/'
end
Please sign in to comment.
Something went wrong with that request. Please try again.