Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## user_controller.rb
- def signup
- case request.method
- when :post
- tpass=(rand(10000)+1000).to_s
- @user = User.new(params[:user])
- @user.update_attribute("password",tpass) # Put the generated password
- if @user.save
- redirect_to :controller => 'user', :action => 'regconfirmation'
- end
- end
- end
- def regconfirmation
- ## show "tpass" to the user like: "Your generated password is: tpass"
- end
- ## regconfirmation.rhtml
- <h1>Your registration has been completed successfully!</h1>
- <p>Your login: <%= @tlogin %></p>
- <p>Your pass: <%= @tpass %></p>
Add Comment
Please, Sign In to add comment