rails accessing value from facebooker hash/array

Posted by Ben on Stack Overflow See other posts from Stack Overflow or by Ben
Published on 2010-01-19T06:31:03Z Indexed on 2010/03/26 22:03 UTC
Read the original article Hit count: 379

Filed under:
|

This is my first time using the facebooker plugin with rails, and I'm having trouble accessing user info. The website uses FB connect to authenticate users.

I am trying to get the name of the university that the logged in user attends.

When I use the command <%= facebook_session.user.education_history[:name] %>, I get an error "Symbol as array index".

I have also tried using education_history[1], but that just returns "# Facebooker::EducationInfo:<some sort of alphanumeric hash value>"

When I use something like <%= facebook_session.user.relationship_status %> , it returns the relationship status just fine. Similarly, <%= facebook_session.user.hometown_location.city %> returns the city name just fine.

I've checked out the documentation for facebooker, but I can't figure out the correct way to get the values I need.

Any idea on how to get this to work?
Thanks!

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about facebook