Controller information in models?

I have a situation where I need information from my controller in my
models.

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.

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
application.

Steve


www.stephenbartholomew.co.uk
www.curve21.com

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs