I need to create a rabl partial, where I need access to an object. For Eg:-
# app/views/posts/index.rabl
collection @posts
node(false) { |post| partial('posts/show', :object => :post)}
Inside show.rabl
# app/views/posts/index.rabl
object @post
node(:details) do
{:id => @post.id}
end
Gives me, undefined method id for nil class. What am I doing wrong? Even the documentation gives the same steps.
Have you tried this?
Hope this helps!