Generic-user-small Oleg Polyakov 1 post

Greetings,

I really enjoy reading your book, though, I have several things that I need to be fixed asap.

I have a requirements to be able to display certain fields based on the drop down selection, which needs to make an Ajax call.

I tried including the following lines into my layouts/application.erb file.

<fb:fbml version="1.1">
<= render :partial=>”layouts/css” %>
<
= javascript_include_tag “facebooker” %>

However, I keep getting an error that it cannot load a static resource.

Here’s things I am not clear:

1) I see facebooker.js under public/javascripts and under Rails plugin directory for facebooker. Is it supposed to be like this?

2) If facebooker.js is all I need to make Ajax calls, can I simply paste this whole code under

3) Do I still need prototype.js to use the Ajax object or it somehow comes through the facebook platform?

4) Is there difference between <fb:fbml version="1.1"> and simply <fb:fbml>

Regards,
Oleg

 
Head_small Mike Mangino 17 posts

What does the generated page look like? Is Rails generating a valid URL for facebooker.js?

Facebooker.js should be both in public/javascripts and in the plugins. It is copied during the install process.

You could paste the code into a script tag.

You don’t need prototype for Ajax. Facebook provides and Ajax object which facebooker.js wraps to make it look like Prototype.

Some features are available with version 1.1 of FBML that aren’t under version 1.0. It shouldn’t make a difference in this case.

If you can post the generated code, that might help figure out what is happening.

2 posts, 2 voices