more fixes, changes, support for new mojang API

This commit is contained in:
jomo
2014-04-18 14:35:18 +02:00
parent 7135d2690c
commit 0264f239ba
62 changed files with 4927 additions and 15 deletions

View File

@@ -36,10 +36,9 @@ class ForumthreadsController < ApplicationController
end
def create
@thread = Forumthread.new(mod? ? thread_params([:sticky, :locked]) : thread_params)
@thread = Forumthread.new(mod? ? thread_params([:sticky, :locked, :forum_id]) : thread_params([:forum_id]))
if @thread.can_write?(current_user)
@thread.user_author = current_user
@thread.forum = @thread.forum
if @thread.save
flash[:notice] = "Thread created!"
redirect_to forumthread_path( @thread)
@@ -71,6 +70,6 @@ class ForumthreadsController < ApplicationController
def thread_params(add = [])
a = [:title, :content]
a += add
params.require(:Forumthread).permit(a)
params.require(:forumthread).permit(a)
end
end