Class: PasswordResetsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/password_resets_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#advertise, #cache_action?, #footer_content, #homepage_features, #plaxo, #rss_site_index, #site_index

Methods included from BaseHelper

#add_friend_link, #ajax_spinner_for, #avatar_for, #block_to_partial, #box, #city_cloud, #clippings_link, #commentable_url, #container_title, #excerpt_with_jump, #flash_class, #forum_page?, #is_current_user_and_featured?, #jumbotron, #last_active, #more_comments_links, #page_title, #paginating_links, #possesive, #profile_completeness, #render_jumbotron, #render_widgets, #rounded, #search_posts_title, #search_user_posts_path, #show_footer_content?, #tag_auto_complete_field, #time_ago_in_words, #time_ago_in_words_or_date, #tiny_mce_init_if_needed, #tiny_mce_js, #topnav_tab, #truncate_words, #truncate_words_with_highlight, #widget

Methods included from LocalizedApplication

#get_matching_ui_locale, #get_sorted_langs_from_accept_header, #get_valid_lang_from_accept_header, #set_locale

Methods included from AuthenticatedSystem

#login_by_token, #update_last_seen_at

Instance Method Details

#createObject


8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/controllers/password_resets_controller.rb', line 8

def create
  @user = User.where("lower(email) = ?", params[:email].downcase).first
  if @user
    @user.deliver_password_reset_instructions!

    flash[:notice] = :your_password_reset_instructions_have_been_emailed_to_you.l

    redirect_to 
  else
    flash[:error] = :sorry_we_dont_recognize_that_email_address.l

    render :action => :new
  end
end

#editObject


23
24
# File 'app/controllers/password_resets_controller.rb', line 23

def edit
end

#newObject


5
6
# File 'app/controllers/password_resets_controller.rb', line 5

def new
end

#updateObject


26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'app/controllers/password_resets_controller.rb', line 26

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