This commit is contained in:
jomo
2013-10-21 05:45:54 +02:00
parent 49b2231047
commit bfe9a1e6f5
14 changed files with 107 additions and 46 deletions

View File

@@ -3,4 +3,20 @@ class ForumthreadsController < ApplicationController
f = Forum.find(params[:id])
redirect_to forum_path(f.forumgroup, f)
end
def new
@forum = Forum.find(params[:id])
if @forum && current_user && (@forum.group.role_read.nil? || @forum.group.role_read <= current_user.role) && (@forum.role_read.nil? || @forum.role_read <= current_user.role)
@thread = Forumthread.new(forum: @forum)
else
flash[:alert] = "You are not allowed to create a new thread here!"
end
end
def create
flash[:alert] = "Not yet ;("
redirect_to forum_path(params[:id])
end
end