This commit is contained in:
jomo
2013-10-14 02:40:44 +02:00
parent acd4c5198f
commit 7c578874c9
17 changed files with 101 additions and 75 deletions

View File

@@ -46,7 +46,8 @@ class BlogpostsController < ApplicationController
def update
@post = Blogpost.find(params[:id])
if mod?
if @post.update_attributes(params[:blogpost])
@post.user_editor = current_user
if @post.update_attributes(params[:blogpost] ? 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"