Skip to content

Instantly share code, notes, and snippets.

@almaron
Created June 22, 2014 08:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save almaron/127dce6cab1aee9d9cdb to your computer and use it in GitHub Desktop.
Save almaron/127dce6cab1aee9d9cdb to your computer and use it in GitHub Desktop.
class User < ActiveRecord::Base
after_create :send_greeting
def send_greeting
SystemMessage.create(user_id: self.id, subject: t("messages.head.greeting"), text: render_to_string(partial:"messages/greeting", locals:{user:self}))
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment