Description:
fixed userlist-add inconsistency
git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@272 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
r136:877c184d2b5d - - 2 files changed: 12 inserted, 7 deleted
@@ -27,32 +27,32 | |||
|
27 | 27 | @user = User.new(params[:user]) |
|
28 | 28 | if @user.save |
|
29 | 29 | flash[:notice] = 'User was successfully created.' |
|
30 | 30 | redirect_to :action => 'list' |
|
31 | 31 | else |
|
32 | 32 | render :action => 'new' |
|
33 | 33 | end |
|
34 | 34 | end |
|
35 | 35 | |
|
36 | 36 | def create_from_list |
|
37 | 37 | lines = params[:user_list] |
|
38 | 38 | lines.split("\n").each do |line| |
|
39 | - items = line.split | |
|
40 |
- if items.length== |
|
|
39 | + items = line.split(',') | |
|
40 | + if items.length==4 | |
|
41 | 41 | user = User.new |
|
42 | 42 | user.login = items[0] |
|
43 |
- user.full_name = |
|
|
44 |
- user.alias = items[ |
|
|
45 |
- user.password = items[ |
|
|
46 |
- user.password_confirmation = items[ |
|
|
43 | + user.full_name = items[1] | |
|
44 | + user.alias = items[2] | |
|
45 | + user.password = items[3] | |
|
46 | + user.password_confirmation = items[3] | |
|
47 | 47 | user.save |
|
48 | 48 | end |
|
49 | 49 | end |
|
50 | 50 | redirect_to :action => 'list' |
|
51 | 51 | end |
|
52 | 52 | |
|
53 | 53 | def edit |
|
54 | 54 | @user = User.find(params[:id]) |
|
55 | 55 | end |
|
56 | 56 | |
|
57 | 57 | def update |
|
58 | 58 | @user = User.find(params[:id]) |
You need to be logged in to leave comments.
Login now