RailsのViewでJSON/ハッシュを整形して見やすく表示
DRANK

ちょっとしたメモなので簡潔に… サンプルコード JSONやハッシュを整形して表示するには、preタグとJSON.pretty_generateを使う。 sample.slim pre = JSON.pretty_generate(JSON.parse(string)) pre = JSON.pretty_generate(hash_object) pre = JSON.pretty_generate({uri: 'httsp://qiita.com/'...

qiita.com
Related Topics: Ruby on Rails
6 comments
  • Thanks for the post. In the modern world, it is important to know useful information and try to understand everything. If you have time to relax, just visit our website and take a break from routine

  • It is an exceptional website fnaf Your essay was exquisitely composed. In my opinion, this is a remarkable document.

  • This article is truly remarkable. The entire thing has been read by me, and I intend to distribute it to the people in my social circles. My intention is to rework your article and post it on my own blog sometime soon. Fun games

  • The way you write is really good. I'm really happy I read it. It kept me interested the whole time quordle

  • Consequently, it has broadened its service offerings to include startups and businesses at all stages of development. only up