Hi I solved it as Michael suggested And it was working .But now i notified another issue. That is why reopening the thread. The issue is, even if the validations fail, mail is sent to user (What I need is only if update happens successfully on changed attributes then only mail to be sent)
controller code is @user = User.find(params[:id]) res = @user.update_attributes_and_notify(params[:user]) if res == true ----do this elsif res == false ----do this elsif res == 'nochange' ----do this end User model code is def update_attributes_and_notify(attributes,user) self.attributes = attributes if changed? deliver_user_edit_details! save else return 'nochange' end end and if I change the line in model deliver_user_edit_details! if save I get error undefined method `call' for nil:NilClass What would be the reason? Please help Thanks Tom -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.