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

@@ -39,8 +39,7 @@ class ForumsController < ApplicationController
def create
if admin?
@forum = Forum.new(forum_params)
@forum.forumgroup = Forumgroup.find(params[:forum][:forumgroup_id])
@forum = Forum.new(forum_params([:forumgroup_id]))
if @forum.save
flash[:notice] = "Forum created."
redirect_to @forum
@@ -66,7 +65,7 @@ class ForumsController < ApplicationController
end
def forum_params(add = [])
a = [:name, :position, :role_read, :role_write] + add
a = [:name, :position, :role_read_id, :role_write_id] + add
params.require(:forum).permit(a)
end
end