Description:
forgot to change prob controller back before commit last change git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@288 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r149:c4d6d4f3628c - - 1 file changed: 3 inserted, 7 deleted

@@ -79,19 +79,15
79 def destroy
79 def destroy
80 Problem.find(params[:id]).destroy
80 Problem.find(params[:id]).destroy
81 redirect_to :action => 'list'
81 redirect_to :action => 'list'
82 end
82 end
83
83
84 def toggle
84 def toggle
85 - respond_to do |wants|
85 + @problem = Problem.find(params[:id])
86 - wants.js {
86 + @problem.available = !(@problem.available)
87 - @problem = Problem.find(params[:id])
87 + @problem.save
88 - @problem.available = !(@problem.available)
89 - @problem.save
90 - }
91 - end
92 end
88 end
93
89
94 def turn_all_off
90 def turn_all_off
95 Problem.find(:all,
91 Problem.find(:all,
96 :conditions => "available = 1").each do |problem|
92 :conditions => "available = 1").each do |problem|
97 problem.available = false
93 problem.available = false
You need to be logged in to leave comments. Login now