Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Sinatra jQuery Mobile App Chunk 4
get '/' do
@events = Event.all(:order => :time.desc)
haml :index
end
get '/new/?' do
haml :new
end
post '/new/?' do
begin
Event.create(
:time => Time.parse(params['time']),
:type => params['type'],
:description => params['description']
)
redirect '/'
rescue
haml :new
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.