Class: Notification
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Notification
- Defined in:
- lib/generators/acts_as_notificable/templates/notification.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.create_notification(template_name, locals = {}) ⇒ Object
15 16 17 |
# File 'lib/generators/acts_as_notificable/templates/notification.rb', line 15 def self.create_notification(template_name, locals = {}) Notification.create(template_name: template_name, locals: locals) end |
Instance Method Details
#render(options = {}) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/generators/acts_as_notificable/templates/notification.rb', line 8 def render( = {}) locals.merge!(notification: self) = { file: "notifications/#{template_name}", locals: locals } [:layout] = "layouts/" + [:layout] if .has_key?(:layout) view.render() end |