Created
June 2, 2017 09:12
-
-
Save sushant12/cfeb58684f61c6dc88b05d3aa5a80a51 to your computer and use it in GitHub Desktop.
updating the task
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
elsif(env[‘PATH_INFO’] ==’/update’ && env[‘REQUEST_METHOD’] == “POST”) | |
req = Rack::Request.new(env) | |
id = req.params[“id”] | |
task = req.params[“task”] | |
finish = 0 | |
if(req.params.include? ‘finished’) | |
finish = 1 | |
end | |
DB.execute(“UPDATE tasks set name = ‘#{task}’, finished = ‘#{finish}’ where rowid=’#{id}’”) | |
return [ 302, {‘Location’ =>”/”}, [] ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment