-# Not all inputs are ng inputs, they don't make the ng-form dirty on change.
-# ng-change is only valid for inputs, not for a form.
-# So we use onchange and have to get the scope to access the ng controller
= form_for [main_app, :admin, @enterprise], html: { name: "enterprise_form",
  "ng-app" => 'admin.enterprises',
  "ng-controller" => 'enterpriseCtrl',
  'onchange' => 'angular.element(enterprise_form).scope().setFormDirty()',
  } do |f|

  %save-bar{ buttons: "[{ text: 'Update', action: submit, param: null, class: 'red' }, { text: 'Cancel', action: cancel, param: '#{main_app.admin_enterprises_path}' }]", form: "enterprise_form" }

  .row
    .sixteen.columns.alpha
      .four.columns.alpha
        = render 'admin/shared/side_menu'
      .one.column &nbsp;
      .eleven.columns.omega.fullwidth_inputs
        = render 'form', f: f

-# Not all inputs are ng inputs, they don't make the ng-form dirty on change.
-# ng-change is only valid for inputs, not for a form.
-# So we use onchange and have to get the scope to access the ng controller
= form_for [main_app, :admin, @enterprise], html: { name: "enterprise_form",
  "ng-app" => 'admin.enterprises',
  "ng-controller" => 'enterpriseCtrl',
  'onchange' => 'angular.element(enterprise_form).scope().setFormDirty()',
  } do |f|

  %save-bar{ dirty: "enterprise_form.$dirty", persist: "true" }
    %input.red{ type: "button", value: "Update", ng: { click: "submit()", disabled: "!enterprise_form.$dirty" } }
    %input{ type: "button", ng: { value: "enterprise_form.$dirty ? 'Cancel' : 'Close'", click: "cancel('#{main_app.admin_enterprises_path}')" } }



  .row
    .sixteen.columns.alpha
      .four.columns.alpha
        = render 'admin/shared/side_menu'
      .one.column &nbsp;
      .eleven.columns.omega.fullwidth_inputs
        = render 'form', f: f

Update editing enterprise page save-bar
Update editing enterprise page save-bar