```ruby
format.json { render json: Member.joins(:person)
                                 .where( "people.name ILIKE ?", "%#{params[:q]}%")
                                 .map { |n| { id: n.id,
                                              name: n.person.name,
                                              dni: n.person.dni,
                                              surname: n.person.surname }
                                      }.to_json
            }
```