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:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r149:c4d6d4f3628c - - 1 file changed: 0 inserted, 4 deleted
@@ -61,55 +61,51 | |||
|
61 | 61 | flash[:notice] = 'Error saving description' |
|
62 | 62 | render :action => 'edit' and return |
|
63 | 63 | end |
|
64 | 64 | @problem.description = @description |
|
65 | 65 | elsif @description!=nil |
|
66 | 66 | if !@description.update_attributes(params[:description]) |
|
67 | 67 | flash[:notice] = 'Error saving description' |
|
68 | 68 | render :action => 'edit' and return |
|
69 | 69 | end |
|
70 | 70 | end |
|
71 | 71 | if @problem.update_attributes(params[:problem]) |
|
72 | 72 | flash[:notice] = 'Problem was successfully updated.' |
|
73 | 73 | redirect_to :action => 'show', :id => @problem |
|
74 | 74 | else |
|
75 | 75 | render :action => 'edit' |
|
76 | 76 | end |
|
77 | 77 | end |
|
78 | 78 | |
|
79 | 79 | def destroy |
|
80 | 80 | Problem.find(params[:id]).destroy |
|
81 | 81 | redirect_to :action => 'list' |
|
82 | 82 | end |
|
83 | 83 | |
|
84 | 84 | def toggle |
|
85 | - respond_to do |wants| | |
|
86 | - wants.js { | |
|
87 | 85 |
|
|
88 | 86 |
|
|
89 | 87 |
|
|
90 | - } | |
|
91 | - end | |
|
92 | 88 | end |
|
93 | 89 | |
|
94 | 90 | def turn_all_off |
|
95 | 91 | Problem.find(:all, |
|
96 | 92 | :conditions => "available = 1").each do |problem| |
|
97 | 93 | problem.available = false |
|
98 | 94 | problem.save |
|
99 | 95 | end |
|
100 | 96 | redirect_to :action => 'list' |
|
101 | 97 | end |
|
102 | 98 | |
|
103 | 99 | def turn_all_on |
|
104 | 100 | Problem.find(:all, |
|
105 | 101 | :conditions => "available = 0").each do |problem| |
|
106 | 102 | problem.available = true |
|
107 | 103 | problem.save |
|
108 | 104 | end |
|
109 | 105 | redirect_to :action => 'list' |
|
110 | 106 | end |
|
111 | 107 | |
|
112 | 108 | def stat |
|
113 | 109 | @problem = Problem.find(params[:id]) |
|
114 | 110 | if !@problem.available |
|
115 | 111 | redirect_to :controller => 'main', :action => 'list' |
You need to be logged in to leave comments.
Login now