내 앱에 thumbs_up 보석을 구현하려고하는데 경로가 있어도이 오류가 계속 발생합니다. vote_up의 행동을경로가 일치하지 않습니다 {: action => "vote_up", : controller => "posts"} thumbs_up에 대한 오류
내 게시물 컨트롤러는
가def vote_up
begin
current_user.vote_for(@post = Post.find(params[:id]))
render :nothing => true, :status => 200
rescue ActiveRecord::RecordInvalid
render :nothing => true, :status => 404
end
end
내 경로
resources :posts do
get :vote_up, :on => :member
resources :comments
end
모양처럼 나는 문제가 무엇인지 모르는 사람이 나를 도울 수 있다면 또는 날 지점 보인다 튜토리얼 엄청나게 될 것 같은 thumbs_up 보석을 사용하십시오.
보기 코드를 공유 할 수 있습니까? – rb512
'current_user.vote_for (@post = Post.find (params [: id]))'. IMHO 메서드의 인수로도 사용되는 과제는 좋은 프로그래밍 습관이 아닙니다. – tokland