added update and edit action to posts_controller