Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9307123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T00:19:29+00:00 2026-06-19T00:19:29+00:00

My index view is pulling all the models from database before the update is

  • 0

My index view is pulling all the models from database before the update is carried out is there any way to make sure these actions are synchronised. the model is updated and shows up in index page after a refresh here is the code

app = angular.module('enterprise',["ngResource"])
 .config(['$routeProvider','$locationProvider','$httpProvider', ($routeProvider,$locationProvider,provider )->         
 $locationProvider.html5Mode(true)
 provider.defaults.headers.common['X-CSRF-Token'] = $('meta[name=csrf-token]').attr('content')

 $routeProvider.when('/', {templateUrl: '<%=asset_path('list.html') %>', controller: AppCtrl})
 $routeProvider.when('/new', {templateUrl: '<%=asset_path('edit.html') %>', controller: NewCtrl})
 $routeProvider.when('/edit/:id', {templateUrl: '<%=asset_path('edit.html') %>', controller: EditCtrl})
 $routeProvider.otherwise({redirectTo: '/'})
]

app.factory "People", ["$resource",($resource)->
  $resource("/people/:id", {id:"@id"},{update: {method:"PUT"}}, {})
]


@AppCtrl=["$scope","People",($scope, People)->
$scope.crew = People.query()
]


@NewCtrl=["$scope","$location", "People",($scope, $location, People) ->
$scope.save = ->
  person = People.save($scope.person)
  $location.path("/")

]
 @EditCtrl=["$scope", "$location", "$routeParams","People",($scope, $location,  $routeParams, People)->
$scope.person = People.get({id:$routeParams.id})

$scope.save = ->
    person = People.get({id:$routeParams.id }
    , ->
       person.name =  $scope.person.name
       person.description = $scope.person.description
       person.$update()
    )
    $location.path("/")

]

any advice on ensuring model is updated before returning to index view

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T00:19:31+00:00Added an answer on June 19, 2026 at 12:19 am

    Put $location.path("/") in the People resource’s callback function. $resource actions have success/failure callbacks.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to print out in the index view, all items from a certain
Take the standard return statement for a controller: return View(Index); is there a way
when destroying one element from my database, the index view <% for activity in
I'm pulling a razor view's markup from the database, as detailed in this question:
I have an index view that I want to update automatically as the user
Consider the following code from index view: <td> <%= 'foo' if bar == BAZ
I have folders and pages /admin/add/index.php, /admin/edit/index.php & /admin/view/index.php which all are requiring page
Is there any way to submit dynamically generated SQL to Teradata? I've written a
I have an index view that lists all of the tags for my Entry
I have Index view: @using System.Web.Mvc.Html @model MsmqTestApp.Models.MsmqData <!DOCTYPE html> <html> <head> <script src=@Url.Content(~/Scripts/jquery.unobtrusive-ajax.min.js)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.