Archived
LOTS of stuff
This commit is contained in:
@@ -34,7 +34,7 @@ class BlogpostsController < ApplicationController
|
||||
if @post.save
|
||||
redirect_to @post, notice: 'Post has been created.'
|
||||
else
|
||||
flash[:alert] = @post.errors.first
|
||||
flash[:alert] = "Error creating blogpost"
|
||||
render action: "new"
|
||||
end
|
||||
else
|
||||
@@ -47,7 +47,7 @@ class BlogpostsController < ApplicationController
|
||||
@post = Blogpost.find(params[:id])
|
||||
if mod? || @comment.author.is?(current_user)
|
||||
@post.user_editor = current_user
|
||||
if @post.update_attributes(params[:blogpost] ? params[:blogpost].slice(:title, :content, :user_editor) : {})
|
||||
if @post.update_attributes(params[:blogpost].slice(:title, :content, :user_editor))
|
||||
redirect_to @post, notice: 'Post has been updated.'
|
||||
else
|
||||
flash[:alert] = "There was a problem while updating the post"
|
||||
|
||||
Reference in New Issue
Block a user