On Feb 21, 11:00 am, Cyrus Dev <rails-mailing-l...@andreas-s.net>
wrote:
> Hello all
>
> I have problem regarding hash and array
>
> I am retriving records using find method and then doing some operations
> on it
> and finally i got results like following
>
> [{"1"=>"75225", "2"=>"Sat"},{"1"=>"75225", "2"=>"Sat"}]
>
> which contains array of hashes
>
> when we write simple find method of any tables it returns
>
> [#, #, #, #] in this way

Sounds like your view just contains <%= some_array %>

Which means that you'll just get the result of calling to_s on each of
your array elements, which is unlikely to be useful and also invalid
html since what it outputs is something like #<SomeObject:
0x12345678> . It is up to you to produce some meaningful textual
output for your array elements (eg <%= h some_array.inspect %> but
even that is pretty crude)

Fred
>
> so can anybody tell me what is difference between this 2 types of array
>
> becuase I dont want to modify my view file
>
> Also can i convert first array of hashes to acitve record type of array
> of hashes
>
> how can we do that ?
>
> Thanks
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to