I have a problem,
please check the code
Fields = Array.new
Fields [0] = "sno"
Fields [1] = "username"
Fields [2] = "designation"
Fields [3] = "salary"
Fields [4] = "dob"
Fields [5] = "email"
Fields [6] = "doj"
These are the fields of the object ''Employee''
The Employees array contains of the set of employee objects...
I need to have the array of hashes as
[{employee_record1},{employee_record2}...... n records]
For this i tried as the...
result = []
for employee in Employees
res = {}
for field in fields
res << { field => employee.send(field)}
end
result << res
end
But it is not working...
Finally i have to replace the ''result'' with the
PDF::SimpleTable.data
through the statement
=> table.data.replace result
which accepts only the hashes... whose columns are the keys and the column
data as values
Please Help me Thank You
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---