mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
Updated and working!
This commit is contained in:
parent
8413451cd1
commit
756b8e5de9
2 changed files with 7 additions and 6 deletions
|
@ -24,7 +24,7 @@ end
|
|||
|
||||
# Custom 404
|
||||
|
||||
get 404 do
|
||||
'Custom 404!!!!'
|
||||
end
|
||||
# get 404 do
|
||||
# 'Custom 404!!!!'
|
||||
# end
|
||||
|
||||
|
|
|
@ -11,8 +11,8 @@ get '/' do
|
|||
%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 @@ post '/clear' do
|
|||
end
|
||||
|
||||
delete '/:id' do
|
||||
|
||||
session[:items].delete_at(params[:id].to_i)
|
||||
redirect '/'
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue