添加了新建参赛作品后弹出新建成功的提示框

This commit is contained in:
wanglinchun 2014-05-10 10:15:51 +08:00
parent 1e39080cf1
commit 38c7216097
3 changed files with 7 additions and 4 deletions

View File

@ -376,10 +376,10 @@ class ContestsController < ApplicationController
contest_message = params[:contest_for_save][:contest_message]
if ContestingSoftapplication.where("softapplication_id = ? and contest_id = ?", softapplication.id, @contest.id).size == 0
if ContestingSoftapplication.create_softapplication_contesting(@contest.id, softapplication.id, contest_message)
flash.now[:notice] = l(:label_release_add_contest_succeed)
flash[:notice] = l(:label_release_add_contest_succeed)
end
else
flash.now[:error] = l(:label_add_contest_succeed_fail)
flash[:error] = l(:label_add_contest_succeed_fail)
end
@contesting_softapplication = paginateHelper @contest.contesting_softapplications

View File

@ -106,11 +106,13 @@ class SoftapplicationsController < ApplicationController
@softapplication.save_attachments(params[:attachments])
respond_to do |format|
if @softapplication.save
format.js
format.html { redirect_to @softapplication, notice: 'Softapplication was successfully created.' }
format.json { render json: @softapplication, status: :created, location: @softapplication }
# format.json { render json: @softapplication, status: :created, location: @softapplication }
else
format.js { render status: 406 }
format.html { render action: "new" }
format.json { render json: @softapplication.errors, status: :unprocessable_entity }
# format.json { render json: @softapplication.errors, status: :unprocessable_entity }
end
end
end

View File

@ -0,0 +1 @@
alert('新建参赛作品成功!');