1
我是Ruby on Rails的新手,而且有點困惑。我有散列的數組中,我通過JSON在助手解析:在Rails中將哈希數組打印到erb中?
a = [{"desc"=>"testdesc1", "owner"=>{"url"=>"https://www.example1.com"},
{"desc"=>"testdesc2", "owner"=>{"url"=>"https://www.example2.com"}]
,現在我想在我的.erb這樣顯示出來:
<h3>name (with link to url)<h3>
<div>desc</div>
我甚至不能首先第一步是解析數組。當我嘗試每個循環的不同變化時,他們只需打印出整個陣列。 有沒有簡單的方法來做到這一點?
這個工作。謝謝! – Slamice