친구를 만들고 싶습니다. 수락이라는 맞춤 동작을 만들었습니다. 그러나 나는 그것을 도달 할 수 없다. 매번 제가 전화를하면 쇼를 찾을 수 없습니다.맞춤 휴식 액션
여기
resources :friendships do
collection do
delete 'cancel'
get 'accept'
end
end
여기 내 route.rb 파일 내가 그것을 호출하는 방법
<%= link_to 'Accept', accept_friendships_path(:friend_id => f) %>
accept_friendships는 레이크 경로 명령에서 가져 왔습니다. 그리고 여기에 내가 정의하는 방법 내 컨트롤러 동의를 여기
#Accept friendships
def accept
if @customer.requested_friends.include?(@friend)
Friendship.accept(@customer, @friend)
flash[:notice] = "Friendship Accepted"
else
flash[:notice] = "No Friendship request"
end
redirect_to root_url
end
오류
Unknown action
The action 'show' could not be found for FriendshipsController
'rake routes' 명령의 실제 출력도 표시하십시오. 어딘가에 약간의 미스 매치/오타가있을 수 있습니다. – jefflunt