Is Anyone working with Ruby....
Is anyone working with ruby on rails... If so can you please tell me about the language and its uses... i am the beginner of ruby... Is anyone done any project in ruby... reply me if so.. thanks... 😀
Administrator • Oct 21, 2008
Member • Oct 23, 2008
Administrator • Oct 23, 2008
Member • Oct 24, 2008
class Notifications < ActionMailer::Base def forgot_password(to, login, pass, sent_at = Time.now) @subject = "Your password is ..." @body['login']=login @body['pass']=pass @recipients = to @from = 'support@yourdomain.com' @sent_on = sent_at headers = {} end end *And also i have generated model named "user", in that i have defined send_new_password function, def send_new_password new_pass = User.random_string(10) self.password = self.password_confirmation = new_pass self.save Notifications.deliver_forgot_password(self.email, self.login, new_pass) end *In controller, def forgot_password if request.post? u= User.find_by_email(params[:user][:email]) if u and u.send_new_password flash[:message] = "A new password has been sent by email." redirect_to :action=>'login', :id=>@user.id else flash[:warning] = "Couldn't send password" end end end*when i enter the email id and submit, the password had been changed and it's not received in my mail. When i relogin using that old password it's not login in. Thats the problem. can u tell me the solution. thanks.....
Member • May 7, 2015