amatsuda/jb

empty array rendered as null instead of []

niksosf opened this issue · 1 comments

Say I have in projects_controller#index action
@projects = []
and I have views/projects/_project.json.rb
{ name: project.name }
and views/projects/index.json.rb
render @projects

whenever @projects = [], I get null as the output json. If, however, I modified index.json.jb to

render partial: 'projects/project', collection: @projects, as: :project

it will output [] is this by design?

Possibly related #11