Looking at my last post, this is my modification: # POST /diagnoses # POST /diagnoses.json def create #flash[:message] = params[:question_ids] # ["1 2", "2 1", "3 2"] right = [] result = [] params[:question_ids].each do |p| result = p.gsub(/\s+/m, ' ').strip.split(" ") if result[1] == Question.find(result[0].to_i).right.to_s then right << result[0] end end if right.empty? r = "0" else r = right.size end flash[:message] = "Richtig sind: " + r.to_s #+ params[:question_ids].to_s + "result: " + result.to_s session[:tmp_diagnosis_raw] = params[:question_ids] session[:tmp_diagnosis_right] = right redirect_to diagnosed_diagnoses_path end def diagnosed @diagnosed_raw = session[:tmp_diagnosis_raw] @diagnosed_right = session[:tmp_diagnosi...
Alles mögliche: private Impressionen, Kocherlebnisse, Politik, Linux, Rails, Gärtnern uvm.