節省一些值數據庫後,我 發現很難把它們打印出來。雖然我已經能夠 拉出數據庫的數據,輸出是這樣的:轉換HASH到數組
@vars={:object=>"46789620999001", :source_id=>1, :comment=>"["This is
my first commenttoday and tommorrow", "This is my first commenttoday
and tommorrow", "This is my first commenttoday and tommorrow", "This
is my first commenttoday and tommorrow", "This is my first comment",
"This is my first comment", "its nice!!!", "Many people do not take
this serious. In this life we have a big role to play in making
ourselves what we would be. It is only God that can help us to live
that life which we have planned, so we can only pray to Him who is the
all and all in our life to help
us."]", :title=>"", :content=>"<div>Life is beautiful. In this life,
whatever you see is what you will use to make out your way. People
around you can help you in many things and ways but can never live
your life for you. It is left for you to live your life, make and take
decisions that you think will help you in living out your dream life.
I believe everybody has a dream life he would like to live. Whatever
decisions one take today will go a long way in determining the kind of
life the one will live in future.<br />Take this as an advise.Bye </
div><div class="blogger-post-footer"><img width='1' height='1'
src='https://blogger.googleusercontent.com/tracker/
6876835757625487750-2447909010390406819?l=godwinagada.blogspot.com'
alt='' /></div>", :author=>"["Godwin",
"ken"]", :category=>"Reality", :post_id=>"", :date=>"2010-06-04", :FileName=>"first"}
>]
請有人可以幫助在提到每個數據在這個 輸出如。
@output.each { |g|
puts g.FileName
puts g.post_id
}
等
什麼是您的數組的指數和值?我在這裏沒有看到任何陣列。 – 2010-06-26 16:12:22