0

我正在尝试输出一个哈希,它是调用 Flickr 的 collection.getTree 方法的结果。

我有:

ap @flickr_collections

它正在打印出散列,但周围有所有转义的 html 标签。我该如何解决这个问题。我确实尝试过.html_safe,但没有奏效。

基本上我想要的只是这个哈希的漂亮打印输出。不多不少。

更新:

这就是我正在运行的:= ap(@flickr_collections, html: true)

输出是:

<pre class="debug_dump">{ <pre>&quot;collections&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre>{ <pre>&quot;collection&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre>[ <kbd style="color:white">[0] </kbd><pre>{ <pre>&quot;set&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre>[ <kbd style="color:white">[0] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157629511800621&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;On-Ride Photography&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[1] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157629391565747&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;First Day with Flash, Rocket &amp; Piper&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre> ]</pre>, <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;57928212-72157629836236274&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Misc&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre>, <pre>&quot;iconlarge&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;/images/collection_default_l.gif&quot;</kbd></pre>, <pre>&quot;iconsmall&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;/images/collection_default_s.gif&quot;</kbd></pre> }</pre>, <kbd style="color:white">[1] </kbd><pre>{ <pre>&quot;collection&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre>[ <kbd style="color:white">[0] </kbd><pre>{ <pre>&quot;set&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre>[ <kbd style="color:white">[ 0] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157629683535562&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 1 - Hollywood Tour and Santa Monica Pier&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[ 1] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157629683541696&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 2 - Drive to Bay Area&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[ 2] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157629683554852&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 3 - Six Flags Discovery Kingdom&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[ 3] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157629710465912&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 4 - Gilroy Gardens &amp; Santa Cruz Beach Boardwalk&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[ 4] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157629710474644&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 5 - California's Great America &amp; Long Drive South&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[ 5] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157629710489442&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 6 - Six Flags Magic Mountain&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[ 6] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157629834618028&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 7 - Universal Studios Hollywood &amp; Scandia Amusement Park &amp; John's Incredible Pizza&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[ 7] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157629834637138&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 8 - Sea World San Diego &amp; Belmont Park&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[ 8] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157629836419418&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 9 - Legoland California &amp; Castle Amusement Park&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[ 9] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157629851123596&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 10 - Knott's Berry Farm &amp; Adventure City&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[10] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157629851700916&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 11 &amp; 12 - Disneyland Resort&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[11] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157629851713058&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 13,14 &amp; 15 - Las Vegas&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre> ]</pre>, <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;57928212-72157629691182748&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;West Coast Tour 2009&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre>, <pre>&quot;iconlarge&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;/images/collection_default_l.gif&quot;</kbd></pre>, <pre>&quot;iconsmall&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;/images/collection_default_s.gif&quot;</kbd></pre> }</pre>, <kbd style="color:white">[1] </kbd><pre>{ <pre>&quot;set&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre>[ <kbd style="color:white">[ 0] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157629866337538&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 0 - Arrival and Mall of America&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[ 1] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157629868655454&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 1 - Mall of America&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[ 2] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157629970737598&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 2 - Adventureland and Worlds of Fun&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[ 3] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157630011649024&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 3 - Worlds of Fun&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[ 4] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157630034790528&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 4 - Silver Dollar City&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[ 5] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157630035520246&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 5 - St Louis Arch and City Museum&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[ 6] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157630043090072&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 6 - Six Flags St Louis&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[ 7] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157630043098290&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 7 - Holiday World&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[ 8] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157630048416804&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 8 - Indiana Beach&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[ 9] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157630048431390&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 9 - Six Flags Great America&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[10] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157629997482351&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 10 - Mount Olympus, Timber Falls and Knuckleheads&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[11] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157630059600702&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 11 - Valleyfair&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre> ]</pre>, <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;57928212-72157629866347760&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Middle America Tour 2010&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre>, <pre>&quot;iconlarge&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;/images/collection_default_l.gif&quot;</kbd></pre>, <pre>&quot;iconsmall&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;/images/collection_default_s.gif&quot;</kbd></pre> }</pre>, <kbd style="color:white">[2] </kbd><pre>{ <pre>&quot;set&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre>[ <kbd style="color:white">[0] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157631693409808&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 1 - Great Wall of China, Tiananmen Square, Forbidden City&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[1] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157630657898798&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 1 - Carowinds&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[2] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157630692436584&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 2 - Dollywood&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[3] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157630699845912&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 3 - Random Pigeon Forge Activities&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[4] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157630714758818&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 4 - Long Drive to Williamsburg&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[5] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157630717785454&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 5 - Busch Gardens Williamsburg&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[6] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157630717785576&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 6 - Kings Dominion&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre> ]</pre>, <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;57928212-72157630658165668&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;IntimidaTOUR 2010&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre>, <pre>&quot;iconlarge&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;/images/collection_default_l.gif&quot;</kbd></pre>, <pre>&quot;iconsmall&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;/images/collection_default_s.gif&quot;</kbd></pre> }</pre>, <kbd style="color:white">[3] </kbd><pre>{ <pre>&quot;set&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre>[ <kbd style="color:white">[ 0] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157631693011733&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 0 - Early Arrival Day, Crab Island Childrens Amusement Park, Crab Island Amusement Park, Aoyun Fuwa Eden, Beijing World Park&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[ 1] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157631693409808&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 1 - Great Wall of China, Tiananmen Square, Forbidden City&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[ 2] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157631698474564&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 2 - Shijingshan Amusement Park, Sun Park&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[ 3] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157631703216195&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 3 - Happy Valley Beijing and visit to 2008 Olympic Park&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[ 4] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157631713251068&quot;</kbd></pre>, <pre>&quot;title&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;Day 4 - Victory Kingdom, Children's Palace, Langfang&quot;</kbd></pre>, <pre>&quot;description&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;&quot;</kbd></pre> }</pre>, <kbd style="color:white">[ 5] </kbd><pre>{ <pre>&quot;id&quot;</pre><kbd style="color:slategray"> =&gt; </kbd><pre><kbd style="color:brown">&quot;72157631761492087&quot;</kbd></pre>, <pre>&quot;title&quot;</pre>

我不能添加其余的输出,因为我只能在这个框中使用 30,000 个字符。以上是输出的第一部分。

如果我在前面添加一个原始调用ap,那么它确实有帮助,但它会在新行上输出每个字符串、哈希箭头和大括号/方括号,这没有任何用处。

我将不胜感激这个问题被重新打开。

4

2 回答 2

0

你想在视图中打印这个?你有没有尝试过

ap(@flickr_collections, :html => true)
于 2013-02-19T22:40:13.193 回答
0

你试过strip_tags吗?

见文档: http ://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-strip_tags

于 2013-02-19T22:27:45.053 回答