I'm trying to return a result to a view where the json does not include the root.

I don't want to set this on all actions for this model,so therefore am trying to avoid setting

ActiveRecord.Base.include_root_in_json = false

I was hoping that I could do

@task = Tasks.all
@task.include_root_in_json = false

To get the response I need, but that doesn't seem to be working, returning an 'undefined method include_root_in_json= for #

Is there a nice way of doing this??

Edit
Report