You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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?
The text was updated successfully, but these errors were encountered: