I'm trying to set up an action link to post to facebook but I'm a bit confused with respect to how do I set up the action on facebook and how do I get koala to post an action link.
Basically I want to post an action link which says:
<name of user> is looking for a travelbuddy
<custom message>
<photo of car> <link to car profile with car title as title>
I'm not sure what should I set up as the action and object here on facebook action links - although I have set up looking as an action and travelbuddy as the object however I am posting details of a vehicle and a link to a profile. Just that its not working right.
Here is my Koala code:
def post_to_facebook
client = Koala::Facebook::API.new(current_user.access_token)
car = Car.find(params[:id])
logger.debug "put_connections(#{url_for car_url(home)}), start"
options = {
:title => home.title,#params[:facebook_post][:title],
:description => params[:facebook_post][:details] ,
:link => car_url(home)#,#params[:facebook_post][:url],
}
if params[:facebook_post][:no_picture] == 'true' then
options[:image] = params[:facebook_post][:image]
end
respond_to do |format|
if client.put_connections(current_user.uid, 'carhq:looking_for', :travelbuddy => car_url(car))
format.json { render json: @home, status: :created }
logger.debug "put_connections(), end"
else
logger.debug "put_connections(), end"
format.json { render json: @home.errors, status: :unprocessable_entity }
end
end
end
I could post a wallpost with this quite easily but can't do the action link. carhq is my application and looking_for is the action I made. Am I going on this right? PLease do help.