Forum: Ruby on Rails Controller information in models?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
328f0bb678423fcea01ebe3b0edc74e6?d=identicon&s=25 Ben Johnson (benjohnson)
on 2007-05-16 20:14
I have a situation where I need information from my controller in my

For example, I want to send out an email to a user notifying them that
their user information was modified. I only want to do this if this is
done in the admin section. In my controller I set a variable called
@admin = true.

How can I get the value of that @admin variable without having to pass
in the controller object every time I create a new ActiveRecord object?

Thanks for your help.
6d57db44c5a4e0721cc7f78cf0ce308a?d=identicon&s=25 Stephen Bartholomew (steveb)
on 2007-05-16 21:17
(Received via mailing list)
I would favor adding some sort of 'update_with_notification' method
instead of trying to get information from the controller.  This would
be much easier and would be better for the structure of your


This topic is locked and can not be replied to.