Created
March 26, 2011 06:51
-
-
Save bradylove/888083 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def update | |
@post = Post.find(params[:id]) | |
@post.published_at = @post.update_published(params[:published], @post.published_at) | |
if @post.update_attributes(params[:post]) | |
redirect_to @post, :notice => "Post has been updated." | |
else | |
flash[:alert] = "Post has not been updated." | |
render :action => "edit" | |
end | |
end | |
def destroy | |
@post = Post.find(params[:id]) | |
@post.destroy | |
redirect_to root_path, :notice => "Post has been deleted." | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment