Class: PasswordResetsController
Instance Method Summary
collapse
#advertise, #cache_action?, #css_help, #footer_content, #homepage_features, #plaxo, #rss_site_index, #site_index
#get_matching_ui_locale, #get_sorted_langs_from_accept_header, #get_valid_lang_from_accept_header, #set_locale
#login_by_token, #update_last_seen_at
Instance Method Details
#create ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'app/controllers/password_resets_controller.rb', line 9
def create
@user = User.find_by_email(params[:email])
if @user
@user.deliver_password_reset_instructions!
flash[:info] = :your_password_reset_instructions_have_been_emailed_to_you.l
redirect_to login_path
else
flash[:error] = :sorry_we_dont_recognize_that_email_address.l
render :action => :new
end
end
|
#edit ⇒ Object
24
25
|
# File 'app/controllers/password_resets_controller.rb', line 24
def edit
end
|
#new ⇒ Object
6
7
|
# File 'app/controllers/password_resets_controller.rb', line 6
def new
end
|
#update ⇒ Object
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'app/controllers/password_resets_controller.rb', line 27
def update
@user.password = params[:password]
@user.password_confirmation = params[:password_confirmation]
if @user.save
flash[:notice] = :your_changes_were_saved.l
redirect_to dashboard_user_path(@user)
else
flash[:error] = @user.errors.full_messages.to_sentence
render :action => :edit
end
end
|