Part 8 - Updating and Deleting Posts
Getting Started
Update Controller Method
def update(self):
post = Post.find(request().param('id'))
return view('update', {'post': post})
def store(self):
post = Post.find(request().param('id'))
post.title = request().input('title')
post.body = request().input('body')
post.save()
return 'post updated'Create The View
Create The Routes:
Delete Method
Make the route:
Update the Template
Last updated