각도로 레일을 사용하여 게시물의 내용을 나열하려하지만 완전히 멈췄습니다.각도와 레일로 '표시'동작
내 컨트롤러 :
def show
@post = Post.find(params[:id])
respond_to do |format|
format.html
format.json { render json: @post }
end
end
'각도에서 안녕하세요'그러나 나머지는 나에게 오류 제공, 벌금 보여주고있다 :
GET http://localhost:3000/posts/show 500 (Internal Server Error)
을
var myApp = angular.module('myApp', ['ngResource']);
myApp.controller('categoryController', ['$scope', 'Post',function($scope, Post) {
$scope.heading = "Hello from angular";
$scope.post = Post.query();
}])
myApp.factory('Post', ['$resource', function($resource) {
return $resource('/posts/:id', { id: "@id" });
}])
게시물 컨트롤러를 레일 이 나쁜 소년을 길을 안내하는 올바른 방법을 알아낼 수 없습니다. 어떤 도움이 입력
편집 주셔서 감사합니다 : routes.rb를
resources :users
resources :hubs, shallow: true do
resources :posts, shallow: true
resources :comments, shallow: true do
collection {post :sort}
end
end
당신이'routes.rb'의 내용을 게시 할 수 호출? – zeantsoi
@zeantsoi 확실한 것! –