Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def edit #index
- @post = Post.find(params[:id])
- end
- def update
- @post = Post.find(params[:id])
- if @post.update_attributes(params[:post])
- redirect_to posts_path, :notice => "Post has been updated."
- else
- render "edit"
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment