John5511 John5511
2008-Oct-19 09:48 UTC
How to pass controller instances class to UserNotifier
Hi,
I am using "UserNotifier < ActionMailer::Base" in model.
In my User Model class I have these
after_create {|user| UserNotifier.deliver_signup_notification(user) }
after_save {|user| UserNotifier.deliver_activation(user) if
user.recently_activated? }
In my view "signup_invitation.rhtml", I have these,
-------------------------------
<%= @user.login %> has just invited you to join <%=
@current_domain.name
%>
---------------------------------------------
Do you guys know how to pass "@current_domain" instant class to view?
I already define @current_domain instance in Application.rb. It does
have value when create user in controller but after UserNotifier call,
the value of @current_domain is nil in "view".
=============================================Or may be is not a good idea to put
"UserNotifier.deliver_signup_notification(user)" in model and put it
in
controller instead.
thank you in advanced,
John
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---