I am working on rails 3.2 . I have a doubt in editting user profile. In my edit form i have avatar field to save the user image and has other fields too for updating first name , lastname, location .. Now i am trying to write a function to send a mail to the supervisor that this user has uploaded avatar. How and where to write this code logic. Should i have to add a custom validate method or how? Give suggestion.
Share
You can create write into model It may be before_save or after_save, It will help you track attribute is changed or not so depending on that you can send notification.
More You can re factor by creating observer and send code to observer.