def update
			@post.assign_attributes(post_params)

			if (params[:publish] == "true") and not @post.published?
				@post.publish
				@post.author = current_author # Reassign author when it's published
			end

			authorize @post

			if @post.valid?
				# Save and rewrite each image in Carrierwave's cache
				@post.body = saved_and_rewrite_cached_images(@post.body)

				@post.save

				redirect_to @post, notice: 'Post was successfully updated.'
			else
				render :edit
			end
		end
def update
			@post.assign_attributes(post_params)

			if (params[:publish] == "true") and not @post.published?
				@post.publish
				@post.author = current_author # Reassign author when it's published
			end

			authorize @post

			if @post.valid?
				# Save and rewrite each image in Carrierwave's cache
				@post.body = saved_and_rewrite_cached_images(@post.body)

				@post.save

				redirect_to @post, notice: 'Post was successfully updated.'
			else
				render :edit
			end
		end
PATCH/PUT /posts/1