Skip to content

Instantly share code, notes, and snippets.

@rociopaez
Last active August 29, 2015 14:06
Show Gist options
  • Save rociopaez/89ad66ad97ff4ba436bf to your computer and use it in GitHub Desktop.
Save rociopaez/89ad66ad97ff4ba436bf to your computer and use it in GitHub Desktop.
on(":id") do |id|
output = Output[id]
on post, param("output") do |params|
date = Date.new(params["date_year"].to_i, params["date_month"].to_i, params["date_day"].to_i)
output.update(date: date, scale: params["scale"], duration: params["duration"])
res.redirect("/outputs")
end
on get do
render("outputs/edit", title: "Edit Output", output: output)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment