Description:
fix some layout problem: first time at main after login, using wrong layouts git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@39 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

r15:ef7a1ef3afd0 - - 1 file changed: 2 inserted, 0 deleted

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