Method: PublicActivity::Renderable#text

Defined in:
lib/public_activity/renderable.rb

#text(params = {}) ⇒ Object

Virtual attribute returning text description of the activity using the activity’s key to translate using i18n.



9
10
11
12
13
14
15
16
# File 'lib/public_activity/renderable.rb', line 9

def text(params = {})
  # TODO: some helper for key transformation for two supported formats
  k = key.split('.')
  k.unshift('activity') if k.first != 'activity'
  k = k.join('.')

  I18n.t(k, parameters.merge(params) || {})
end