Integrating Ajax IM in rails


Hi all,
Now days everyone looking for integration of well developed php based
forums, calendars…and many in to their rails applications. Even I
want to integrate php based Ajax IM chat client into my rails project.
If anybody has done that integration please give me how to go about this
integration otherwise general instruction how to integrate php based
applications to RoR projects.
Thanks in advance,