add example to use template #16

gfrancesco opened this Issue Dec 3, 2012 · 2 comments


None yet

2 participants


Thanks for the great work, can you please give me a hint on how to integrate Rabl (
I've ActiveRecord running, but I'm quite stuck at adding templates/controllers.



Found a way, just anybody needs Rabl with ActiveRecord:

  • add rabl to your Gemfile
  • add in lib/app.rb:
require 'rabl'
  • as service implementation:
service.implementation do
  @foo = Car.find(params[:id])
  Rabl::Renderer.json(@foo, 'cars', view_path: 'views')
  • put your cars.rabl template under views/
@gfrancesco gfrancesco closed this Dec 4, 2012
mattetti commented Dec 4, 2012

Thanks for finding the solution and posting it here. I don't use Rabl but I'm glad to see you got it working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment