def update @post = Post.find(params[:id]) if @post.update_attributes(params[:post]) redirect_to posts_path, :notice => "Tu post se ha actualizado" else render "edit" end end