Rails and Theme Centric Design

I’ve been developing a system in PHP5 that began as a loose MVC
architecture. At some point though, we decided to introduce themes, and
we didn’t want people confined to having to have specific ‘pages’ in
their theme for the site to operate. Rather we wanted a series of basic
API calls that users could access in their themes and get data. These
api calls naturally arose out of the controller methods I had been
creating.

So far the system works well, but the framework is getting overwhelming
and it would make sense on some level to move away from our custom
framework, and move towards one supported by a large community.

It’s basic method of working is it interperts the url, trys to find a
template based on the url, then inside the template are the API calls
which return data.

I’m wondering if anyone has ideas as to how you could get Rails to act a
similar way. What I’m thinking is that the system would act more as a
template selector application and the theme would be more of the app.
Nearly all the controllers would just return data, and not be associated
with a view.

Is anyone already developing something like this? Any ideas out there?