Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def sol1_create
- @reponse = Reponse.new(params[:reponse])
- @reponse.id_videos = "1"
- @reponse.id_candidats = session[:candidat]
- @reponse.save
- @expert = Reponse.find(:all,:conditions => ['id_candidats = :id_candidats and id_videos = :id_videos', { :id_candidats => '1' , :id_videos => '1' }] )
- @expert.each { |l| @res_exec = l.execution}
- @diff = @res_exec - @reponse.execution
- @reponse.res_exec = @diff
- breakpoint
- flash[:notice] = 'Reponse was successfully created.'
- redirect_to :action => 'sol2'
- end
- irb(#<UserController:0xa79596f4>):003:0* @diff
- => 0.8
- irb(#<UserController:0xa79596f4>):004:0> @reponse.res_exec
- => 0
Add Comment
Please, Sign In to add comment