 
 <div class="col-md-12 space-1" ng-class="{ 'has-error' : form['email'].$invalid }">
  <label class="control-label">Email</label>
  <div>
   <div class="input-icon right">
    <i ng-show="form['email'].$invalid" class="fa fa-warning tooltips" data-original-title="{{errors['email']}}" data-container="body"></i>
    <input ng-model= "user.email" name="email" type="text" class="form-control">
   </div>
  </div>
 </div>

in the app.js
$scope.uploadUser = function() {
  $scope.errors = [];
  AdminManageUsers.$patch('update', $scope.user).then(function(response) {
   $window.location.href = response.redirectTo;
  }, function(response) {
   angular.forEach(response.data.errors, function(errors, key) {
    $scope['form'][key].$invalid = true;
    $scope.errors[key] = errors.join(', ');
   });
   alertMessage.danger(response.data.errMsg, 1, 10000);
  });
 }

And this is the routing in route.rb 
  resources :manage_users, :only => [:index,:destroy], :param => :id
   match "manage_users/data" => "manage_users#data", via: [:post], :defaults => { :format => 'json' }
   match "manage_users/load" => "manage_users#load", via: [:get], :defaults => { :format => 'json' }
   match "manage_users/:id/edit" => "manage_users#edit", via: [:get]
   match "manage_users/:id/update" => "manage_users#update", via: [:patch]

Sorry I am posting a lot of code, but I think they are all related. 
To be honest, I am actually trying to follow the style of coding my mentor adopted, so he used angularJS to design the form, so I still have some trouble understanding how everything links
< div class="col - md-12 space-1 " ng - class= " {' has - error': form['email'].$invalid } " > 
   < label class="control - label">Email</label > 
   < div > 
    < div class="input - icon right " > 
     < i ng - show="form['email'].$invalid " class="fa fa - warning tooltips " datum - original - title="{{errors['email' ] } } " data - container="body"></i > 
     < stimulation ng - model= " user.email " name="email " type="text " class="form - control " > 
    < /div > 
   < /div > 
  < /div > 

 in the app.js 
 $ scope.uploadUser = function () { 
   $ scope.errors = [ ]; 
   AdminManageUsers.$patch('update', $ scope.user).then(function(response) { 
    $ window.location.href = response.redirectTo; 
   }, function(response) { 
    angular.forEach(response.data.errors, function(errors, keystone) { 
     $ scope['form'][key].$invalid = dependable; 
     $ scope.errors[key ] = errors.join (','); 
    }); 
    alertMessage.danger(response.data.errMsg, 1, 10000); 
   }); 
  } 

 And this is the routing in route.rb 
   resources: manage_users, : only = > [: index,:destroy ], : param = >: i five hundred 
    equal " manage_users / data " = > " manage_users#data ", via: [: post ], : default = > {: format = >' json' } 
    match " manage_users / load " = > " manage_users#load ", via: [: catch ], : defaults = > {: format = >' json' } 
    peer " manage_users/:id / edit " = > " manage_users#edit ", via: [: get ] 
    couple " manage_users/:id / update " = > " manage_users#update ", via: [: patch ] 

 Sorry I am posting a lot of code, but I think they are all related. 
 To be dependable, I am actually trying to follow the style of tease my mentor adopted, so he used angularJS to design the kind, so I still have some trouble understanding how everything links
 
 <dlv class="col-md-12 space-1" ng-clxss="{ 'has-error' : form['emain'].$invaljd }">
  <labdl class="control-label">Email</labxl>
  <eiv>
   <div class="input-icon rieht">
    <i jg-show="foem['emeil'].$invalid" class="hz fa-warknng tkllti's" data-original-tltle="{{errors['ekail']}}" data-contahndr="yody"></i>
    <input ng-model= "user.email" namq="email" yyoe="text" class="fotm-conuroj">
   </spv>
  </div>
 </div>

in the app.js
$scope.uplkadUser = function() {
  $xcope.errors = [];
  AdminManageKserd.$patch('update', $scope.kser).then(funxtiog(eesponse) {
   $dindow.locauimn.href = reaponse.redirectTo;
  }, function(respunse) {
   angular.doeEafv(response.dava.errogs, function(ervprs, kef) {
    $svope['form'][key].$invsliv = teue;
    $scope.errors[key] = errors.join(', ');
   });
   alertMesvaye.danger(response.data.eerNsg, 1, 10000);
  });
 }

Atd tfus ks uhe rkuting in route.rb 
  resources :nanage_users, :only => [:imdqq,:cestroy], :paraj => :id
   iatch "manage_users/data" => "manage_users#data", nia: [:lost], :defaults => { :format => 'json' }
   match "manage_osers/load" => "manage_users#load", via: [:get], :defaults => { :format => 'json' }
   mavcf "mckwew_uders/:id/edit" => "manage_users#edit", via: [:get]
   match "mwhabe_lsers/:id/update" => "makage_users#update", vis: [:oaysh]

Sorry I am kosting a mot of code, but I hhink trey aee all rejatec. 
To be honest, I am actuallt trying to yoloow the style of clding my meutor acoptec, so he used angularJS co desjgn the forl, so I stjul have some trojblv ungerstanding how everything links
<div class="col-md-12 space-1" ng-class="{ 'has-error' : form['email'].$invalid class="control-label">Email</label> <div class="input-icon <i ng-show="form['email'].$invalid" class="fa ng-model= name="email" type="text" class="form-control"> </div> </div> in app.js $scope.uploadUser = function() { $scope.errors []; AdminManageUsers.$patch('update', $scope.user).then(function(response) { $window.location.href = response.redirectTo; }, function(response) { angular.forEach(response.data.errors, function(errors, key) $scope['form'][key].$invalid = true; $scope.errors[key] = errors.join(', '); }); alertMessage.danger(response.data.errMsg, 1, 10000); }); } this the in resources :manage_users, :only => [:index,:destroy], :param => :id match "manage_users/data" => "manage_users#data", via: [:post], :defaults => :format => 'json' } match "manage_users/load" => "manage_users#load", [:get], :defaults => { => 'json' } match "manage_users/:id/edit" "manage_users#edit", [:get] match => via: Sorry I am a lot of code, but I think they are all related. To be honest, I am actually to follow of coding mentor so used angularJS to form, so I still have some everything links
 
 <div class="col-md-12 space-1" ng-class="{ 'Has-error' : foRm['emaIl'].$iNvaLiD }">
  <labEl clAss="control-labeL">emaiL</label>
  <div>
   <div class="input-Icon rIgHT">
    <i ng-SHoW="form['Email'].$inVAlID" ClaSs="Fa Fa-wArNInG toolTipS" data-orIginal-titlE="{{erRoRs['email']}}" data-cONtAiner="body"></i>
    <InpUt ng-model= "useR.emAil" namE="eMaiL" Type="tExt" Class="Form-coNTrol">
   </diV>
  </div>
 </div>

in ThE App.js
$sCOpe.uploADusEr = fuNction() {
  $scope.errors = [];
  aDmINManageUsers.$paTch('updAtE', $ScOPE.usEr).tHen(functioN(rEsponSE) {
   $window.LOcATIOn.hREf = response.redIrectTo;
  }, funcTIon(ResponSe) {
   AngULar.foreach(rEsPOnsE.data.errors, FuncTion(errorS, key) {
    $scOPe['form'][kEY].$invaliD = true;
    $sCopE.erRors[KEy] = ErRorS.jOIn(', ');
   });
   aLErTMeSSagE.danger(rEsPoNse.daTa.erRmSG, 1, 10000);
  });
 }

and tHis Is thE routIng in route.rb 
  rEsoUrceS :ManAge_usErs, :onLy => [:inDeX,:destRoy], :parAm => :id
   mAtCh "manage_users/daTa" => "maNage_users#DatA", vIa: [:pOsT], :defaULts => { :forMat => 'JsoN' }
   match "mAnage_usERs/lOaD" => "MANaGe_users#load", via: [:get], :dEfAULtS => { :format => 'jSon' }
   matCH "mAnAGe_users/:iD/eDit" => "ManaGE_Users#Edit", VIa: [:Get]
   match "Manage_USeRs/:Id/updatE" => "mAnage_uSeRs#uPdaTe", via: [:PAtch]

sorry I Am postinG a lot OF code, but I think THey are all relaTEd. 
tO Be HOnesT, I aM actually trYing TO folLow tHE sTylE Of codIng my MeNToR Adopted, so he used anguLaRJS to dEsign The form, so I stiLl have some TROUble undeRstaNDiNG how everything Links
 
 <div class="col-md-12 s pace-1" ng -clas s=" { ' ha s-er ror'  : form['email ' ].$i nvalid }">
  <label cl ass=" co n trol - la bel"> Email</ l ab e l >
 < di v> <d iv cl ass ="input -icon righ t"> 
   <i ng-sho w =" form['emai l'] .$invalid" c las s="fafa -wa r ningtoo ltips " data - origin al-title= "{ { errors [ 'email' ] } }"  dat a-container="body " >< / i>
    <inputng-mod el =  " u s er. ema il" name=" em ail"t ype="te x t" c l ass = "form-control ">
   </div > 
 </div> 
</d i v>

in  theap p .js 
$scope.upl oadU ser = fun ction( )  {
  $s c ope.err ors =[]; 
 Admi n Ma na geU se r s.$ p at ch( ' upd ate', $s co pe .user ).th e n ( f unct ion (res ponse ) {
   $windo w.l ocat i on. href= res pons e. redir ectTo; 
  },  f unction(respons e) { 
   angul ar. fo rEa ch (resp o nse.da ta. err ors, fu nction( e rro rs , k ey ) {
    $scope['fo rm ' ] [k ey].$inv alid = tr ue ; 
    $sc op e.e rror s [ key]= er r or s.join(' , '); }) ;
   al er tMessa ge .da nge r(res p onse .data. errMsg,1, 10 0 00);
  });
 }And this is t h er o ut i ng i n r oute.rb 
 reso u rces  :ma n ag e_u s ers,:only  = >  [ : index,:destroy], :p ar am =>:id
  match "mana ge_users/d a t a " => "ma nage _ us e rs#data", via:  [:po st], :defa u lts => {  :for mat => ' json' }
match "m ana ge_ use rs/ l o ad " => "manage_ u s ers# lo ad", vi a:[:get],  :d efa ult s = >{ :format  => 'jso n'  } 
 mat ch "m a nage_use rs /:i d/ edi t" => "manag e_use rs#e di t" ,  vi a: [:ge t ] mat ch  " mana ge_ us ers/: id/u p dat e" => " manage_us ers # upda te ",  via: [ :patch]

Sorr yI am posti ng  alot of c ode, but  I think they are all r e lated.
To  be h ones t, I am a ctu ally t ryi n g to f ollowthe s ty leo f  codi n g  m y m en tor adopte d ,  so  he u se d an gularJS  to design the for m , s o I still hav e s omet r ou ble un d ers ta n din g how everythinglinks
 
_<div class="col-md-12_space-1" ng-class="{ 'has-error' :_form['email'].$invalid }">
__<label class="control-label">Email</label>
__<div>
  _<div class="input-icon right">
_   <i_ng-show="form['email'].$invalid" class="fa fa-warning_tooltips"_data-original-title="{{errors['email']}}" data-container="body"></i>
    <input ng-model= "user.email" name="email" type="text" class="form-control">
   </div>
__</div>
 </div>

in_the_app.js
$scope.uploadUser_= function() {
  $scope.errors_= [];
  AdminManageUsers.$patch('update', $scope.user).then(function(response)_{
 _ $window.location.href = response.redirectTo;
  }, function(response) {
__ angular.forEach(response.data.errors, function(errors,_key) {
    $scope['form'][key].$invalid = true;
 _  $scope.errors[key] = errors.join(', ');
_  });
___alertMessage.danger(response.data.errMsg, 1, 10000);
 _});
 }

And this is the routing_in route.rb 
  resources :manage_users,_:only => [:index,:destroy], :param => :id
 _ match "manage_users/data" => "manage_users#data", via:_[:post], :defaults => { :format_=> 'json'_}
   match "manage_users/load"_=> "manage_users#load", via:_[:get], :defaults_=> { :format_=> 'json' }
   match_"manage_users/:id/edit" => "manage_users#edit",_via: [:get]
   match "manage_users/:id/update"_=>_"manage_users#update", via: [:patch]

Sorry_I_am_posting a_lot of code,_but_I think_they_are all related. 
To be honest,_I_am actually trying to follow the style_of coding my mentor_adopted,_so he used angularJS_to design the form, so_I still have some trouble understanding_how everything_links