Module: SolidLog::UI::EntriesHelper

Defined in:
app/helpers/solid_log/ui/entries_helper.rb

Instance Method Summary collapse

Instance Method Details

#pretty_json(json_string) ⇒ Object

Entry-specific helpers (not shared across other controllers)



6
7
8
9
10
11
12
13
# File 'app/helpers/solid_log/ui/entries_helper.rb', line 6

def pretty_json(json_string)
  return "" if json_string.blank?

  hash = JSON.parse(json_string)
  JSON.pretty_generate(hash)
rescue JSON::ParserError
  json_string
end