Skip to content

Instantly share code, notes, and snippets.

@rociopaez
Last active August 29, 2015 14:05
Show Gist options
  • Save rociopaez/fb42a0d585339578989e to your computer and use it in GitHub Desktop.
Save rociopaez/fb42a0d585339578989e to your computer and use it in GitHub Desktop.
on("profile") do
render("/profile", title: "Profile", current_user: current_user)
on post, param("user") do |params|
update_profile = UpdateProfile.new(params)
update_profile.current_email = current_user.email
on update_profile.valid? do
user = current_user
user.name = update_profile.name
user.email = update_profile.email
user.save
res.redirect("/profile")
end
end
on get do
render("profile/show", title: "Profile", current_user: current_user)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment