I am new to Ruby, so this question might look stupid for you, yeah. But still... I got a model Group, and when I run this
class GroupsController < ApplicationController
prepend SimpleCommand
...
def index
@group = Group.all
render json: @group
end
...
# some other stuff
...and then I get a response with array like this:
[
{
"id": 1020,
"name": "НІ-16-1",
"has_subgroups": true,
"created_at": "2017-09-29T10:14:08.000Z",
"updated_at": "2017-09-29T10:14:08.000Z"
}
...
]
but I don't want to have those two last fields, so my answer is How to get rid of "created_at" and "updated_at" fields in a response?
UPD:
Found a great solution in original question I've accidentally made a duplicate for. Go ahead and read it