Show More
Commit Description:
[web] small fix in template...
Commit Description:
[web] small fix in template
git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@132 6386c4cd-e34a-4fa8-8920-d93eb39b512e
References:
File last commit:
Show/Diff file:
Action:
app/controllers/users_controller.rb
| 27 lines
| 658 B
| text/x-ruby
| RubyLexer
|
|
r0 | class UsersController < ApplicationController | ||
|
r13 | |||
before_filter :authenticate | ||||
verify :method => :post, :only => [:chg_passwd], | ||||
:redirect_to => { :action => :index } | ||||
|
r18 | in_place_edit_for :user, :alias_for_editing | ||
in_place_edit_for :user, :email_for_editing | ||||
|
r13 | |||
def index | ||||
@user = User.find(session[:user_id]) | ||||
end | ||||
def chg_passwd | ||||
user = User.find(session[:user_id]) | ||||
user.password = params[:passwd] | ||||
user.password_confirmation = params[:passwd_verify] | ||||
if user.save | ||||
flash[:notice] = 'password changed' | ||||
else | ||||
flash[:notice] = 'Error: password changing failed' | ||||
end | ||||
redirect_to :action => 'index' | ||||
end | ||||
|
r0 | end | ||