socialforge/app/controllers/myshixuns_controller.rb

29 lines
857 B
Ruby
Raw Normal View History

2017-03-09 17:03:50 +08:00
class MyshixunsController < ApplicationController
2017-03-10 15:41:44 +08:00
layout 'base_myshixun'
skip_before_filter :verify_authenticity_token, :only => [:training_task_status]
before_filter :require_login, :except => [:training_task_status]
before_filter :find_myshixun, :only => [:show]
def training_task_status
status = params[:status].to_i
task_id = params[:taskId]
outPut = params[:outPut]
message = Base64.decode64(params[:msg]) unless params[:msg].blank?
GameOutputs.create(:code => status, :msg => message, :game_id => task_id, :out_put => outPut)
end
def show
respond_to do |format|
format.html{redirect_to myshixun_games_path(@myshixun)}
end
end
private
# Find myshixun of id params[:id]
def find_myshixun
@myshixun = Myshixun.find(params[:id])
rescue ActiveRecord::RecordNotFound
render_404
end
2017-03-09 17:03:50 +08:00
end