I am a Rails Newbie.
I am using fb_graph gem to extract information. Rails 3.2.1 & Ruby 1.9.2p290
In my controller I have
@user_facebook = FbGraph::User.fetch('my.Name', :access_token => 'myaccesstoken')
In my view, I have
<%= @user_facebook.name %><br/>
<%= @user_facebook.identifier %><br/>
<%= @user_facebook.picture %><br/>
<%= @user_facebook.link %><br/>
<%= @user_facebook.username %><br/>
<%= @user_facebook.bio %><br/>
<%= @user_facebook.birthday %><br/>
The Output is displayed as it is intended but..
for <%= @user_facebook.education %> I get the entire array of objects as the facebook document says..
[#<FbGraph::Education:0x007f950bc0a088 @school=#<FbGraph::Page:0x007f950bc09d90 @identifier="134788803212663", @endpoint="https://graph.facebook.com/134788803212663", @access_token=nil, @cached_collections={}, **@name="abcdefghijkl"**, @username=nil, @category=nil, @talking_about_count=nil, @like_count=nil, @affiliation=nil, @artists_we_like=nil, @attire=nil, @awards=nil, @band_interests=nil, @band_members=nil, @bio=nil, @booking_agent=nil, @can_post=nil, @company_overview=nil, @culinary_team=nil ............. ..... ........ ....@founded=nil, @release_date=nil, @checkin_count=nil, @hours={}>>]
When I use this <%= @user_facebook.education.first %>
i get #<FbGraph::Education:0x007f950f47c330>
and
When I use this <%= @user_facebook.education.last %>
i get #<FbGraph::Education:0x007f950e4e1790>
How can I get a simple list of all the schools I went.. [its in @name] but I not sure, who to extract just that information.
Looking for help and support! Thanks!
Based on my reading of the code for FbGraph::Education it should be
@user_facebook.education[0].school. It is an object with attrs to access for information.