简体   繁体   中英

Rails use RABL and jbuilder in the same app?

I have a Rails app that is currently using RABL for json. I have code I can copy that's written in jbuilder. Eventually, I want to confer the app to all jbuilder.

But, in the mean time, can I have both RABL and jbuilder in the same app?

For instance have both of these type files:

locations.json.jbuilder
show.json.rabl

Thanks for the info!

Yes, I've done it, no problem. RABL and JBUILDER can coexist in the same rails project.

As long as you don't use a RABL and JBUILDER view with the same name. My recollection is that the jbuilder view took precedence but that might have been a quirk of my application.

Personally I prefer the flexibility of RABL... it gives you both json and xml for no extra cost.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM