Sha256: 0065e26a9c48569740df6bf8e808a16b7441036eb878a9bbec563bce0489253c

Contents?: true

Size: 379 Bytes

Versions: 4

Compression:

Stored size: 379 Bytes

Contents

# frozen_string_literal: true

module LoggableActivity
  # Helper methods for activities
  module ActivitiesHelper
    require 'json'
    def activity_action(activity)
      I18n.t("loggable_activity.#{activity.action}")
    end

    def format_json_for_display(hash_data)
      JSON.pretty_generate(hash_data)
    rescue JSON::ParserError
      hash_data.to_s
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
loggable_activity-0.5.7 app/helpers/loggable_activity/activities_helper.rb
loggable_activity-0.5.6 app/helpers/loggable_activity/activities_helper.rb
loggable_activity-0.5.4 app/helpers/loggable_activity/activities_helper.rb
loggable_activity-0.5.0 app/helpers/loggable_activity/activities_helper.rb