Hi all,
I''ve integrated a "reset password" facility on the site
I''m developing
allowing the user to reset their password if they forget it. The
problem I am having is that the link to the reset page is not showing
up as a hyperlink.
My User_Mailer looks like this
def forgot_password(user)
setup_email(user)
@subject += ''linkITB - Reset Password''
@body[:url] = "http://localhost:3000/user/reset_password/"#
{user.reset_password_code}"
end
protected
def setup_email(user)
@recipients = "#{user.email}"
@from = "admin-06IhcF583fayZ7Fz/ZYYxQ@public.gmane.org"
@subject = "[linkITB.ie] "
@sent_on = Time.now
@body[:user] = user
end
end
My views/ user_mailer is:
Hi <%= @user.user_name %>,
Your password has been reset.
You can now login by using the following link <%= @url %>
Regards,
The linkITB team
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
This may be just a typing-error but have you closed the quotations
after password/ in your mailer model like you have here?
Try setting this in the mailer method:
body :url => "http://localhost:3000/user/reset_password/#
{user.reset_password_code}"
and then in the view <%= link_to "click here", @url %>
Or ---
In the view simply specify the full url
<%= link_to ''click here'', url_for(:controller =>
''users'', :action =>
''reset_password'', :params=> (your params)), :host =>
''your host here)
%>
It''s important to specify the host in the mailer views.
Hope this helps
On 18 Feb, 09:53, Shockmeister
<B00020...-oe7qfRrRQfe0UHL9wTsh4w@public.gmane.org>
wrote:> Hi all,
>
> I''ve integrated a "reset password" facility on the site
I''m developing
> allowing the user to reset their password if they forget it. The
> problem I am having is that the link to the reset page is not showing
> up as a hyperlink.
>
> My User_Mailer looks like this
>
> def forgot_password(user)
> setup_email(user)
> @subject += ''linkITB - Reset Password''
> @body[:url] = "http://localhost:3000/user/reset_password/"#
> {user.reset_password_code}"
> end
>
> protected
> def setup_email(user)
> @recipients = "#{user.email}"
> @from =
"ad...-06IhcF583fayZ7Fz/ZYYxQ@public.gmane.org"
> @subject = "[linkITB.ie] "
> @sent_on = Time.now
> @body[:user] = user
> end
> end
>
> My views/ user_mailer is:
>
> Hi <%= @user.user_name %>,
>
> Your password has been reset.
>
> You can now login by using the following link <%= @url %>
>
> Regards,
>
> The linkITB team
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Yeah, sorry, that was a typo!! It should have been like you have written it. I''ll try the second implementation and see if that works. Thanks On Feb 18, 10:19 am, Gavin <ga...-YMj/zd8x6QpKMzDMP321V2ksYUyLi9NM@public.gmane.org> wrote:> This may be just a typing-error but have you closed the quotations > after password/ in your mailer model like you have here? > > Try setting this in the mailer method: > > body :url => "http://localhost:3000/user/reset_password/# > {user.reset_password_code}" > > and then in the view <%= link_to "click here", @url %> > > Or --- > > In the view simply specify the full url > <%= link_to ''click here'', url_for(:controller => ''users'', :action => > ''reset_password'', :params=> (your params)), :host => ''your host here) > %> > > It''s important to specify the host in the mailer views. > > Hope this helps > > On 18 Feb, 09:53, Shockmeister <B00020...-oe7qfRrRQfe0UHL9wTsh4w@public.gmane.org> wrote: > > > > > Hi all, > > > I''ve integrated a "reset password" facility on the site I''m developing > > allowing the user to reset their password if they forget it. The > > problem I am having is that the link to the reset page is not showing > > up as a hyperlink. > > > My User_Mailer looks like this > > > def forgot_password(user) > > setup_email(user) > > @subject += ''linkITB - Reset Password'' > > @body[:url] = "http://localhost:3000/user/reset_password/"# > > {user.reset_password_code}" > > end > > > protected > > def setup_email(user) > > @recipients = "#{user.email}" > > @from = "ad...-06IhcF583fayZ7Fz/ZYYxQ@public.gmane.org" > > @subject = "[linkITB.ie] " > > @sent_on = Time.now > > @body[:user] = user > > end > > end > > > My views/ user_mailer is: > > > Hi <%= @user.user_name %>, > > > Your password has been reset. > > > You can now login by using the following link <%= @url %> > > > Regards, > > > The linkITB team- Hide quoted text - > > - Show quoted text ---~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---