修改新建帖子bug(open_source_project)

This commit is contained in:
fanqiang 2014-05-21 10:04:06 +08:00
parent c5dd0317c2
commit 290d07ffdd
1 changed files with 2 additions and 1 deletions

View File

@ -92,13 +92,14 @@ class RelativeMemosController < ApplicationController
def create def create
@memo = RelativeMemo.new(params[:relative_memo]) @memo = RelativeMemo.new(params[:relative_memo])
# @memo.url = "http://forge.trustie.net/open_source_projects" # @memo.url = "http://forge.trustie.net/open_source_projects"
@memo.osp_id = params[:open_source_project_id] # @memo.osp_id = params[:open_source_project_id]
@memo.author_id = User.current.id @memo.author_id = User.current.id
@memo.save_attachments(params[:attachments] || (params[:relative_memo] && params[:relative_memo][:uploads])) @memo.save_attachments(params[:attachments] || (params[:relative_memo] && params[:relative_memo][:uploads]))
respond_to do |format| respond_to do |format|
if @memo.save if @memo.save
RelativeMemoToOpenSourceProject.create(:osp_id => params[:open_source_project_id], :relative_memo_id => @memo.id)
format.html { redirect_to back_memo_url, notice: "#{l :label_memo_create_succ}" } format.html { redirect_to back_memo_url, notice: "#{l :label_memo_create_succ}" }
format.json { render json: @memo, status: :created, location: @memo } format.json { render json: @memo, status: :created, location: @memo }
else else