ruby-grape / grape-rabl

Use rabl with grape
MIT License
136 stars 29 forks source link

Using extends on collections #17

Closed lloydmeta closed 11 years ago

lloydmeta commented 11 years ago

I'm trying to do rendering of a collection via extends and passing in another template like here only I'm not using locals.

I have this in my stories/show.rabl

object @story
attributes :title, :description, :url

and this in my stories/index.rabl

collection @stories
extends 'stories/show'

I get an error ""undefined method `resolve_template' for #Grape::Endpoint:0x007f8f471a1778"".

However, if I change index.rabl to look like

collection @stories

attributes :title, :description, :url

It works fine. Any ideas?

LTe commented 11 years ago

@lloydmeta do you use Padrino?

lloydmeta commented 11 years ago

Yes, I'm currently using Grape mounted inside Padrino.

LTe commented 11 years ago

@lloydmeta this is rabl issue. I already created pull request for that in rabl project ;) pull request

lloydmeta commented 11 years ago

Very nice :+1: !

LTe commented 11 years ago

@lloydmeta until @nesquena will not merge my pull request you can change Gemfile

gem 'rabl', :github => 'LTe/rabl', :branch => 'padrino_lookup'

I will close this issue. Thanks for report!

lloydmeta commented 11 years ago

@LTe Awesome ! Works great :)

nesquena commented 11 years ago

Released just now as a part of rabl 0.8.6

LTe commented 11 years ago

Great news :-) 28 cze 2013 23:36, "Nathan Esquenazi" notifications@github.com napisał(a):

Released just now as a part of rabl 0.8.6

— Reply to this email directly or view it on GitHubhttps://github.com/LTe/grape-rabl/issues/17#issuecomment-20215853 .

lloydmeta commented 11 years ago

@nesquena thanks !

nesquena commented 11 years ago

Thanks @LTe for contributing and maintaining grape-rabl. I use this gem and grape for several of my RABL APIs. It's a great combination.