I am trying to show the index action of a rails app with an angular
front-end. Currently, I am able to save the input to my rails model, but
no objects are loaded to the page when I refresh. Here is my index action:
def index
respond_with Todo.all
end
and here is my TodoController:
function TodoController($scope, $filter, $resource) {
Todo = $resource("/todos", {id: "@id"}, {update: {method: 'PUT'}})
$scope.todos = Todo.query()
and here is my view:
<div class="roundedTwo">
<input type="checkbox" ng-model="todo.done">
<span class="done-{{todo.done}} todos">{{todo.title}} -
{{todo.importance}}</span>
</div>
I know that putting the query() method on the object is supposed to return
as array, but nothing is showing on the page. If I create an object on the
page is saves to the database and shows that new object but when I refresh
the page none of the objects show.
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.