|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
# added by fq
|
|
|
|
|
class ForumsController < ApplicationController
|
|
|
|
|
layout "users_base"
|
|
|
|
|
|
|
|
|
|
include ApplicationHelper
|
|
|
|
|
# GET /forums
|
|
|
|
|
# GET /forums.json
|
|
|
|
|
before_filter :find_forum_if_available
|
|
|
|
@ -63,6 +63,9 @@ class ForumsController < ApplicationController
|
|
|
|
|
|
|
|
|
|
respond_to do |format|
|
|
|
|
|
if @memo.save
|
|
|
|
|
ids = params[:asset_id].split(',')
|
|
|
|
|
update_kindeditor_assets_owner ids ,@memo.id,1
|
|
|
|
|
#end
|
|
|
|
|
format.html { redirect_to (forum_memo_url(@forum, (@memo.parent_id.nil? ? @memo : @memo.parent_id))), notice: "#{l :label_memo_create_succ}" }
|
|
|
|
|
format.json { render json: @memo, status: :created, location: @memo }
|
|
|
|
|
else
|
|
|
|
@ -163,6 +166,13 @@ class ForumsController < ApplicationController
|
|
|
|
|
@forum = Forum.new(params[:forum])
|
|
|
|
|
@forum.creator_id = User.current.id
|
|
|
|
|
if @forum.save
|
|
|
|
|
# Time 2015-03-24 17:07:05
|
|
|
|
|
# Author lizanle
|
|
|
|
|
# Description after save后需要进行资源记录的更新
|
|
|
|
|
# owner_type = 2 对应的是 forum
|
|
|
|
|
ids = params[:asset_id].split(',')
|
|
|
|
|
update_kindeditor_assets_owner ids ,@forum.id,2
|
|
|
|
|
#end
|
|
|
|
|
respond_to do |format|
|
|
|
|
|
|
|
|
|
|
format.html { redirect_to @forum, notice: l(:label_forum_create_succ) }
|
|
|
|
|