Class: Muck::UsernameRequestController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/muck/username_request_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

Forgot username action



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'app/controllers/muck/username_request_controller.rb', line 15

def create
  @title = t('muck.users.username_request')
  if @user = User.find_by_email(params[:request_username][:email])
    @user.deliver_username_request!
    flash[:notice] = t('muck.users.username_sent')
    respond_to do |format|
      format.html { redirect_to  }
    end
  else
    flash[:notice] = t('muck.users.could_not_find_user_with_email')
    respond_to do |format|
      format.html { render :template => 'username_request/new' }
    end
  end  
end

#newObject

Enter email address to recover username



7
8
9
10
11
12
# File 'app/controllers/muck/username_request_controller.rb', line 7

def new
  @title = t('muck.users.username_request')
  respond_to do |format|
    format.html { render :template => 'username_request/new' }
  end
end