Rails : facebook open graph -


i creating first story in facebook graph on rails app. have created story product upload.

so when user creates products, story gets published on timeline saying "user created new product sell. check out."

i got code object facebook. not getting write code in app. should on product upload file new_product.html.erb or should create new file in product folder?

if create new file, how load when new product gets created new_product.html.erb file calls show_product.file on product upload. how set 2 actions on creation of product?

i totally new rails , facebook graph. can here?

here work follow working this.

for publishing story need write custom code on view file meta tag. have send post request product url. here exaple: suppose product in on http://yoursite.com/product/124. , 1 comments on product. have following things publish story product.

create action called comment object product app dashboard. write meta tag on view (like show.html.erb) head as

<meta property="og:site_name" content="yoursite.com"> <meta property="fb:app_id" content="xxxxxxxxxxxxxx"> <meta property="og:type" content="namespace:product"> <meta property="og:url" content="http://yoursite.com/product/124"> <meta property="og:title" content="product name"> <meta property="og:description" content="description"> <meta property="og:image" content="http://yoursite.com/product/124.jpg"> 

3.finally make post request when comment on product, can use koala post this.

@graph = koala::facebook::api.new(oauth_access_token)

@graph.put_connections("me", "namespace:comment", :product => "http://yoursite.com/product/124", :message => "send message here.")   

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -