Skip to content

Rabl not renders collection properly #726

@zauzaj

Description

@zauzaj

Hi,

I'm struggling with some issue and not sure how to get out of it:
Here is my labels/index.rabl

collection @labels

attribute :id, :name

When I do next

renderer = Rabl::Renderer.new('labels/index', Label.limit(4), { :format => 'json', :view_path => 'app/views/api/pro/v2' }).render
 =>  "{\"name\":\"Label\"}"

which is totally wrong as it should display collection as an array of 4 hashes with proper id & name.

I'm not sure why it does like this.

So I'm using rails 4.2.11 & rabl 0.14.1

Wdyt?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions