Description:
fixed layout bugs again -- added explicit layout in main_controller git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@50 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

r26:a3328dc4a80b - - 1 file changed: 2 inserted, 0 deleted

@@ -1,28 +1,30
1 class MainController < ApplicationController
1 class MainController < ApplicationController
2
2
3 before_filter :authenticate, :except => [:index, :login]
3 before_filter :authenticate, :except => [:index, :login]
4
4
5 + layout 'application'
6 +
5 verify :method => :post, :only => [:submit],
7 verify :method => :post, :only => [:submit],
6 :redirect_to => { :action => :index }
8 :redirect_to => { :action => :index }
7
9
8
10
9 def index
11 def index
10 redirect_to :action => 'login'
12 redirect_to :action => 'login'
11 end
13 end
12
14
13 def login
15 def login
14 MainController.layout 'empty'
16 MainController.layout 'empty'
15 reset_session
17 reset_session
16 end
18 end
17
19
18 def list
20 def list
19 @problems = Problem.find_available_problems
21 @problems = Problem.find_available_problems
20 @prob_submissions = Array.new
22 @prob_submissions = Array.new
21 @user = User.find(session[:user_id])
23 @user = User.find(session[:user_id])
22 @problems.each do |p|
24 @problems.each do |p|
23 c, sub = Submission.find_by_user_and_problem(@user.id,p.id)
25 c, sub = Submission.find_by_user_and_problem(@user.id,p.id)
24 @prob_submissions << [c,sub]
26 @prob_submissions << [c,sub]
25 end
27 end
26 end
28 end
27
29
28 def submit
30 def submit
You need to be logged in to leave comments. Login now