Created
June 2, 2017 09:09
-
-
Save sushant12/a2f4ef1d26e9927b355688e39bba6adb to your computer and use it in GitHub Desktop.
saving to db
This file contains hidden or 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’] == ‘/save_task’ && env[‘REQUEST_METHOD’] == “POST”) | |
req = Rack::Request.new(env) | |
task_name = req.params[“task”] | |
DB.execute(“INSERT INTO tasks (name, finished) VALUES (?, ?)”, [task_name,0]) | |
return [ 302, {‘Location’ =>”/”}, [] ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment