LOTS of stuff

This commit is contained in:
jomo
2014-04-04 01:08:17 +02:00
parent 0604bbce63
commit f290258f26
62 changed files with 1457 additions and 655 deletions
+2 -2
View File
@@ -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"