diff --git a/src/app/views/crud/crud.html b/src/app/views/crud/crud.html
index adb0500..b162cc5 100644
--- a/src/app/views/crud/crud.html
+++ b/src/app/views/crud/crud.html
@@ -19,29 +19,26 @@
         <hr>
     </div>
 </div>
-<div class="row" ng-show="vm.related.length > 0 && vm.model.id">
-    <div class="view-header">
-        <div class="col-lg-4">
-            <h4>Related Items: </h4>
-        </div>
-        <div class="col-lg-8 text-right">
-            <div class="btn-group">
-                <a ng-if="vm.list" ng-repeat="r in vm.related" href="#/core/{{r.model.toLowerCase()}}s/" class="btn btn-default">
-                    {{r.model}}
-                </a>
-                <a ng-if="!vm.list && vm.getRelatedItem(r, vm.model)" ng-repeat="r in vm.related" href="#/core/{{r.model.toLowerCase()}}s/{{vm.getRelatedItem(r, vm.model)}}" class="btn btn-default">
-                    {{r.model}}
-                </a>
-            </div>
-        </div>
-        <hr>
-    </div>
-</div>
 <div ng-if="vm.list">
     <xos-table config="vm.tableCfg" data="vm.tableData"></xos-table>
 </div>
 
 <div ng-if="!vm.list">
-    <!--<pre>{{vm.model | json}}</pre>-->
-    <xos-form ng-model="vm.model" config="vm.formCfg"></xos-form>
+    <uib-tabset active="active">
+        <uib-tab heading="{{vm.data.model}}">
+            <div class="panel-body">
+                <xos-form ng-model="vm.model" config="vm.formCfg"></xos-form>
+            </div>
+        </uib-tab>
+        <uib-tab ng-if="vm.getRelatedItemId(r, vm.model)" ng-repeat="r in vm.related.manytoone" heading="{{r.model}} {{vm.getHumanReadableOnField(r)}}">
+            <div class="panel-body">
+                <xos-form ng-model="vm.relatedModels.manytoone[r.model][r.on_field].model" config="vm.relatedModels.manytoone[r.model][r.on_field].formConfig"></xos-form>
+            </div>
+        </uib-tab>
+        <uib-tab classes="{{vm.relatedModels.onetomany[r.model][r.on_field].class}}" ng-if="vm.relatedModels.onetomany[r.model]" ng-repeat="r in vm.related.onetomany" heading="{{r.model}} {{vm.getHumanReadableOnField(r)}}">
+            <div class="panel-body">
+                <xos-table config="vm.relatedModels.onetomany[r.model][r.on_field].tableConfig" data="vm.relatedModels.onetomany[r.model][r.on_field].model"></xos-table>
+            </div>
+        </uib-tab>
+    </uib-tabset>
 </div>
diff --git a/src/app/views/crud/crud.relations.service.spec.ts b/src/app/views/crud/crud.relations.service.spec.ts
new file mode 100644
index 0000000..8c0f2f9
--- /dev/null
+++ b/src/app/views/crud/crud.relations.service.spec.ts
@@ -0,0 +1,196 @@
+import {
+  IXosCrudRelationService, XosCrudRelationService, IXosCrudRelationFormTabData,
+  IXosCrudRelationTableTabData
+} from './crud.relations.service';
+import {BehaviorSubject} from 'rxjs';
+import {ConfigHelpers} from '../../core/services/helpers/config.helpers';
+
+const XosModelStoreMock = {
+  get: null,
+  query: null
+};
+
+const XosModelDiscovererMock = {
+  get: null
+};
+
+let service, scope;
+
+describe('The XosCrudRelation service', () => {
+  beforeEach(() => {
+    angular
+      .module('test', ['ui.router', 'toastr'])
+      .service('XosCrudRelation', XosCrudRelationService)
+      .value('XosModelStore', XosModelStoreMock)
+      .value('XosModelDiscoverer', XosModelDiscovererMock)
+      .service('ConfigHelpers', ConfigHelpers);
+
+    angular.mock.module('test');
+  });
+
+  beforeEach(angular.mock.inject((XosCrudRelation: IXosCrudRelationService, $rootScope: ng.IScope) => {
+    service = XosCrudRelation;
+    scope = $rootScope;
+  }));
+
+  it('should have the correct methods', () => {
+    expect(service.getModel).toBeDefined();
+    expect(service.getModels).toBeDefined();
+    expect(service.existsRelatedItem).toBeDefined();
+  });
+
+  describe('the existsRelatedItem method', () => {
+    it('should return true if the we have a reference to the related model', () => {
+      const relation = {
+        model: 'Test',
+        type: 'manytoone',
+        on_field: 'test'
+      };
+      const item = {test_id: 5};
+
+      const res = service.existsRelatedItem(relation, item);
+      expect(res).toBeTruthy();
+    });
+    it('should return false if the we don\'t have a reference to the related model', () => {
+      const relation = {
+        model: 'Test',
+        type: 'manytoone',
+        on_field: 'test'
+      };
+      const item = {foo: 5};
+
+      const res = service.existsRelatedItem(relation, item);
+      expect(res).toBeFalsy();
+    });
+  });
+
+  describe('the getHumanReadableOnField method', () => {
+    it('should return a human readable version of the on_field param', () => {
+      const relation = {
+        model: 'Test',
+        type: 'onetomany',
+        on_field: 'relate_to_test'
+      };
+
+      const res = service.getHumanReadableOnField(relation, 'Instance');
+      expect(res).toEqual('[Relate to test]');
+    });
+
+    it('should return am empty string if the on_field param equal the model param', () => {
+      const relation = {
+        model: 'Test',
+        type: 'onetomany',
+        on_field: 'test'
+      };
+
+      const res = service.getHumanReadableOnField(relation, 'Instance');
+      expect(res).toEqual('');
+    });
+
+    it('should return am empty string if the type on_field equal the base model', () => {
+      const relation = {
+        model: 'Test',
+        type: 'manytoone',
+        on_field: 'instance'
+      };
+
+      const res = service.getHumanReadableOnField(relation, 'Instance');
+      expect(res).toEqual('');
+    });
+  });
+
+  describe('the getModel method', () => {
+    it('should return the tab config for a single object', (done) => {
+      const relation = {
+        model: 'Test',
+        type: 'manytoone',
+        on_field: 'test'
+      };
+
+      const resModel = {foo: 'bar'};
+      const resFormCfg = {form: 'config'};
+
+      spyOn(XosModelStoreMock, 'get').and.callFake(() => {
+        const subject = new BehaviorSubject({});
+        subject.next(resModel);
+        return subject.asObservable();
+      });
+      spyOn(XosModelDiscovererMock, 'get').and.returnValue({formCfg: resFormCfg});
+
+      service.getModel(relation, '5')
+        .then((res: IXosCrudRelationFormTabData) => {
+          expect(res.model).toEqual(resModel);
+          expect(res.class).toEqual('full');
+          expect(res.formConfig).toEqual(resFormCfg);
+          done();
+        });
+      scope.$apply();
+    });
+  });
+
+  describe('the getModels method', () => {
+    it('should return one related model', (done) => {
+      const relation = {
+        model: 'Test',
+        type: 'onetomany',
+        on_field: 'test'
+      };
+
+      const resModels = [
+        {test_id: 5},
+        {test_id: 25}
+      ];
+      const resTableCfg = {table: 'config'};
+
+      spyOn(XosModelStoreMock, 'query').and.callFake(() => {
+        const subject = new BehaviorSubject(resModels);
+        return subject.asObservable();
+      });
+      spyOn(XosModelDiscovererMock, 'get').and.returnValue({tableCfg: resTableCfg});
+
+      service.getModels(relation, 5)
+        .then((res: IXosCrudRelationTableTabData) => {
+          expect(res.model.length).toEqual(1);
+          expect(res.class).toEqual('full');
+          expect(res.tableConfig).toEqual({
+            table: 'config',
+            filter: null
+          });
+          done();
+        });
+      scope.$apply();
+    });
+
+    it('should not return related models', (done) => {
+      const relation = {
+        model: 'Test',
+        type: 'onetomany',
+        on_field: 'test'
+      };
+
+      const resModels = [
+        {test_id: 15},
+        {test_id: 25}
+      ];
+      const resTableCfg = {table: 'config'};
+
+      spyOn(XosModelStoreMock, 'query').and.callFake(() => {
+        const subject = new BehaviorSubject(resModels);
+        return subject.asObservable();
+      });
+      spyOn(XosModelDiscovererMock, 'get').and.returnValue({tableCfg: resTableCfg});
+
+      service.getModels(relation, 5)
+        .then((res: IXosCrudRelationTableTabData) => {
+          expect(res.model.length).toEqual(0);
+          expect(res.class).toEqual('empty');
+          expect(res.tableConfig).toEqual({
+            table: 'config',
+            filter: null
+          });
+          done();
+        });
+      scope.$apply();
+    });
+  });
+});
diff --git a/src/app/views/crud/crud.relations.service.ts b/src/app/views/crud/crud.relations.service.ts
new file mode 100644
index 0000000..292c6f5
--- /dev/null
+++ b/src/app/views/crud/crud.relations.service.ts
@@ -0,0 +1,109 @@
+import {IXosModelRelation} from './crud';
+import {IXosModelStoreService} from '../../datasources/stores/model.store';
+import {IXosModelDiscovererService} from '../../datasources/helpers/model-discoverer.service';
+import * as _ from 'lodash';
+import {IXosFormCfg} from '../../core/form/form';
+import {IXosTableCfg} from '../../core/table/table';
+import {IXosConfigHelpersService} from '../../core/services/helpers/config.helpers';
+
+interface IXosCrudRelationBaseTabData {
+  model: any;
+  class?: 'full' | 'empty';
+}
+
+export interface IXosCrudRelationFormTabData extends IXosCrudRelationBaseTabData {
+  formConfig: IXosFormCfg;
+}
+
+export interface IXosCrudRelationTableTabData extends IXosCrudRelationBaseTabData {
+  tableConfig: IXosTableCfg;
+}
+
+export interface IXosCrudRelationService {
+  getModel(r: IXosModelRelation, id: string | number): Promise<IXosCrudRelationFormTabData>;
+  getModels(r: IXosModelRelation, source_id: string | number): Promise<IXosCrudRelationTableTabData>;
+  existsRelatedItem(r: IXosModelRelation, item: any): boolean;
+  getHumanReadableOnField(r: IXosModelRelation, baseModel: string): string;
+}
+
+export class XosCrudRelationService implements IXosCrudRelationService {
+
+  static $inject = [
+    '$log',
+    '$q',
+    'XosModelStore',
+    'XosModelDiscoverer',
+    'ConfigHelpers'
+  ];
+
+  constructor (
+    private $log: ng.ILogService,
+    private $q: ng.IQService,
+    private XosModelStore: IXosModelStoreService,
+    private XosModelDiscovererService: IXosModelDiscovererService,
+    private ConfigHelpers: IXosConfigHelpersService
+  ) {}
+
+  public getModel (r: IXosModelRelation, id: string | number): Promise<IXosCrudRelationFormTabData> {
+    const d = this.$q.defer();
+    this.XosModelStore.get(r.model, id)
+      .subscribe(
+        item => {
+          this.$log.debug(`[XosCrud] Loaded manytoone relation with ${r.model} on ${r.on_field}`, item);
+
+          const data: IXosCrudRelationFormTabData = {
+            model: item,
+            formConfig: this.XosModelDiscovererService.get(r.model).formCfg,
+            class: angular ? 'full' : 'empty'
+          };
+
+          d.resolve(data);
+        },
+        err => d.reject
+      );
+    return d.promise;
+  };
+
+  public getModels(r: IXosModelRelation, source_id: string | number): Promise<IXosCrudRelationTableTabData> {
+    const d = this.$q.defer();
+
+    this.XosModelStore.query(r.model)
+      .subscribe(
+        items => {
+          this.$log.debug(`[XosCrud] Loaded onetomany relation with ${r.model} on ${r.on_field}`, items);
+          // building the filter parameters
+          const match = {};
+          match[`${r.on_field.toLowerCase()}_id`] = source_id;
+          const filtered = _.filter(items, match);
+          // removing search bar from table
+          const tableCfg = this.XosModelDiscovererService.get(r.model).tableCfg;
+          tableCfg.filter = null;
+
+          const data: IXosCrudRelationTableTabData = {
+            model: filtered,
+            tableConfig: tableCfg,
+            class: filtered.length > 0 ? 'full' : 'empty'
+          };
+
+          d.resolve(data);
+        },
+        err => d.reject
+      );
+
+    return d.promise;
+  }
+
+  public existsRelatedItem(r: IXosModelRelation, item: any): boolean {
+    return item && angular.isDefined(item[`${r.on_field.toLowerCase()}_id`]);
+  }
+
+  public getHumanReadableOnField(r: IXosModelRelation, baseModel: string): string {
+    if (r.on_field.toLowerCase() === baseModel.toLowerCase()) {
+      return '';
+    }
+    if (r.model.toLowerCase() === r.on_field.toLowerCase()) {
+      return '';
+    }
+    return `[${this.ConfigHelpers.toLabel(r.on_field, false)}]`;
+  }
+}
diff --git a/src/app/views/crud/crud.scss b/src/app/views/crud/crud.scss
new file mode 100644
index 0000000..ac6fd81
--- /dev/null
+++ b/src/app/views/crud/crud.scss
@@ -0,0 +1,7 @@
+@import './../../style/vars.scss';
+li.uib-tab {
+  &.empty > a {
+    color: $color-placeholder;
+    font-style: italic;
+  }
+}
\ No newline at end of file
diff --git a/src/app/views/crud/crud.ts b/src/app/views/crud/crud.ts
index 90d3342..fc422f3 100644
--- a/src/app/views/crud/crud.ts
+++ b/src/app/views/crud/crud.ts
@@ -2,35 +2,34 @@
 import {IXosModelStoreService} from '../../datasources/stores/model.store';
 import {IXosConfigHelpersService} from '../../core/services/helpers/config.helpers';
 import * as _ from 'lodash';
-import {IXosFormCfg} from '../../core/form/form';
 import {IXosResourceService} from '../../datasources/rest/model.rest';
 import {IStoreHelpersService} from '../../datasources/helpers/store.helpers';
 import {IXosModelDiscovererService} from '../../datasources/helpers/model-discoverer.service';
-
-export interface IXosCrudData {
-  model: string;
-  related: IXosModelRelation[];
-  xosTableCfg: IXosTableCfg;
-  xosFormCfg: IXosFormCfg;
-}
+import './crud.scss';
+import {IXosCrudRelationService} from './crud.relations.service';
 
 export interface IXosModelRelation {
   model: string;
   type: string;
+  on_field: string;
 }
 
 class CrudController {
   static $inject = [
     '$scope',
+    '$log',
     '$state',
     '$stateParams',
     'XosModelStore',
     'ConfigHelpers',
     'ModelRest',
     'StoreHelpers',
-    'XosModelDiscoverer'
+    'XosModelDiscoverer',
+    'XosCrudRelation'
   ];
 
+  // bindings
+
   public data: {model: string};
   public tableCfg: IXosTableCfg;
   public formCfg: any;
@@ -39,18 +38,28 @@
   public title: string;
   public tableData: any[];
   public model: any;
-  public related: string[];
+  public related: {manytoone: IXosModelRelation[], onetomany: IXosModelRelation[]} = {
+    manytoone: [],
+    onetomany: []
+  };
+  public relatedModels: {manytoone: any, onetomany: any} = {
+    manytoone: {},
+    onetomany: {}
+  };
 
   constructor(
     private $scope: angular.IScope,
+    private $log: angular.ILogService,
     private $state: angular.ui.IStateService,
     private $stateParams: ng.ui.IStateParamsService,
     private store: IXosModelStoreService,
     private ConfigHelpers: IXosConfigHelpersService,
     private ModelRest: IXosResourceService,
     private StoreHelpers: IStoreHelpersService,
-    private XosModelDiscovererService: IXosModelDiscovererService
+    private XosModelDiscovererService: IXosModelDiscovererService,
+    private XosCrudRelation: IXosCrudRelationService
   ) {
+
     this.data = this.$state.current.data;
     this.model = this.XosModelDiscovererService.get(this.data.model);
     this.title = this.ConfigHelpers.pluralize(this.data.model);
@@ -60,8 +69,7 @@
     // TODO get the proper URL from model discoverer
     this.baseUrl = '#/' + this.model.clientUrl.replace(':id?', '');
 
-
-    this.related = $state.current.data.related;
+    this.$log.debug('[XosCrud]', $state.current.data);
 
     this.tableCfg = this.model.tableCfg;
     this.formCfg = this.model.formCfg;
@@ -76,7 +84,10 @@
 
             // if it is a detail page for an existing model
             if ($stateParams['id'] && $stateParams['id'] !== 'add') {
+              this.related.onetomany = _.filter($state.current.data.relations, {type: 'onetomany'});
+              this.related.manytoone = _.filter($state.current.data.relations, {type: 'manytoone'});
               this.model = _.find(this.tableData, {id: parseInt($stateParams['id'], 10)});
+              this.getRelatedModels(this.related, this.model);
             }
           });
         }
@@ -96,11 +107,59 @@
     }
   }
 
-  public getRelatedItem(relation: IXosModelRelation, item: any): number {
-    if (item && angular.isDefined(item[`${relation.model.toLowerCase()}_id`])) {
-      return item[`${relation.model.toLowerCase()}_id`];
-    }
-    return 0;
+
+  public getRelatedItemId(relation: IXosModelRelation, item: any): boolean {
+    return this.XosCrudRelation.existsRelatedItem(relation, item);
+  }
+
+  public getHumanReadableOnField(r: IXosModelRelation) {
+    return this.XosCrudRelation.getHumanReadableOnField(r, this.data.model);
+  }
+
+  public getRelatedModels(relations: {manytoone: IXosModelRelation[], onetomany: IXosModelRelation[]}, item: any) {
+    this.$log.info(`[XosCrud] Managing relation for ${this.data.model}:`, relations);
+
+    // loading many to one relations (you'll get a model)
+    _.forEach(relations.manytoone, (r: IXosModelRelation) => {
+      if (!item || !item[`${r.on_field.toLowerCase()}_id`]) {
+        return;
+      }
+
+      this.$log.debug(`[XosCrud] Loading manytoone relation with ${r.model} on ${r.on_field}`);
+
+      if (!angular.isDefined(this.relatedModels.manytoone[r.model])) {
+        this.relatedModels.manytoone[r.model] = {};
+      }
+
+      this.XosCrudRelation.getModel(r, item[`${r.on_field.toLowerCase()}_id`])
+        .then(res => {
+          this.relatedModels.manytoone[r.model][r.on_field] = res;
+        })
+        .catch(err => {
+          this.$log.error(`[XosCrud] Error loading manytoone relation with ${r.model} on ${r.on_field}`, err);
+        });
+    });
+
+    // loading onetomany relations (you'll get a list of models)
+    _.forEach(relations.onetomany, (r: IXosModelRelation) => {
+      if (!item) {
+        return;
+      }
+
+      this.$log.debug(`[XosCrud] Loading onetomany relation with ${r.model} on ${r.on_field}`);
+
+      if (!angular.isDefined(this.relatedModels.onetomany[r.model])) {
+        this.relatedModels.onetomany[r.model] = {};
+      }
+
+      this.XosCrudRelation.getModels(r, item.id)
+        .then(res => {
+          this.relatedModels.onetomany[r.model][r.on_field] = res;
+        })
+        .catch(err => {
+          this.$log.error(`[XosCrud] Error loading onetomany relation with ${r.model} on ${r.on_field}`, err);
+        });
+    });
   }
 }
 
diff --git a/src/app/views/index.ts b/src/app/views/index.ts
index ee87ef9..b296f9b 100644
--- a/src/app/views/index.ts
+++ b/src/app/views/index.ts
@@ -1,10 +1,12 @@
 import {xosCore} from '../core/index';
 import {xosCrud} from './crud/crud';
 import {xosDashboard} from './dashboard/dashboard';
+import {XosCrudRelationService} from './crud/crud.relations.service';
 
 export const xosViews = 'xosViews';
 
 angular
   .module('xosViews', [xosCore])
+  .service('XosCrudRelation', XosCrudRelationService)
   .component('xosCrud', xosCrud)
   .component('xosDashboard', xosDashboard);
