난 레일 3.1 앱을 가지고 있는데, 아약스를 통해 내 이미지를 지우는 것 같습니다. 내 코드 smaple 내가 나를 위해 작동하지 않습니다레일에서 아약스를 통해 객체를 삭제하기 3.1rc4
$('.delete_post').bind('ajax:success', function() {
$(this).closest('tr').fadeOut();
});
가 난 내 application.js에서
<%= link_to '(delete)', profile_photo_path(photo.profile, photo), :method => :delete if me %>
을 내 뷰에서 다음
def destroy
@photo = Photo.find(params[:id])
@photo.destroy
respond_to do |format|
format.html { redirect_to(user_photos_path(current_user)) }
format.js { render :nothing => true }
end
end
입니다. 작업을 수행하지만 페이드 아웃하지 않습니다.
다시 한번 감사 – Uchenna