app/controllers/miniblog/admin/posts_controller.rb in miniblog-1.0.0.beta vs app/controllers/miniblog/admin/posts_controller.rb in miniblog-1.0.0
- old
+ new
@@ -19,10 +19,11 @@
@post = Post.new(post_params)
@post.state = :drafted
@post.author = current_user
@post.regenerate_permalink
if @post.save
+ after_post_is_saved
redirect_to miniblog.edit_admin_post_path(@post), notice: "Post created succesfully"
else
render action: :new
end
end
@@ -43,9 +44,10 @@
if @post.update_attributes(post_params)
if @post.allowed_to_update_permalink?
@post.regenerate_permalink
@post.save!
end
+ after_post_is_saved
flash[:notice] = "Post updated succesfully"
end
render action: :edit
end