Guest User

Untitled

a guest
Mar 13th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. ## user_controller.rb
  2.  
  3. def signup
  4. case request.method
  5. when :post
  6. tpass=(rand(10000)+1000).to_s
  7. @user = User.new(params[:user])
  8. @user.update_attribute("password",tpass) # Put the generated password
  9. if @user.save
  10. redirect_to :controller => 'user', :action => 'regconfirmation'
  11. end
  12. end
  13. end
  14.  
  15. def regconfirmation
  16. ## show "tpass" to the user like: "Your generated password is: tpass"
  17. end
  18.  
  19. ## regconfirmation.rhtml
  20.  
  21. <h1>Your registration has been completed successfully!</h1>
  22.  
  23. <p>Your login: <%= @tlogin %></p>
  24. <p>Your pass: <%= @tpass %></p>
Add Comment
Please, Sign In to add comment