how to mix php and ruby / rails

I have a php web application. I also have a ruby / rails application. I want to have the ruby / rails app generate it's output within a <div> section in the php web application. Is this possible?

Normally, you can have a function generate html within a <div> section because the server generates the html code. So, can I have a ruby / rails application send its stuff to the div section in a php based site?

Thanks ravigit