Ruby passing sql data to Javascript

In my application I need to grab static data (at load time) from a
database and have it available to send to Javascript functions at a
later time. Is RoR well suited to do this or should I be cosidering a
different language such as PHP? If this can be done with Ruby can
someone link to an example or attach a code snippet?

Thanks
Joe