0
rails3 응용 프로그램이 있고 jquery-rails를 사용하고 있습니다. 내 다른 모델의 모든 개체는 삭제할 수 있지만 내 이미지는 삭제할 수 없습니다.Rails3 이미지에서의 라우팅 오류 # 파괴 - 왜 이유는 모르겠지만 ... "경로가 일치하지 않습니다 ..."- 클립 클립?
클립 문제 일 수 있습니까?
images_controller.rb
def destroy
@image = Image.find(params[:id])
@image.destroy
flash[:notice] = "Successfully destroyed image."
redirect_to images_url
end
routes.rb
resources :images do
resources :comments
end
레이크 노선
images GET /images(.:format) {:action=>"index", :controller=>"images"}
POST /images(.:format) {:action=>"create", :controller=>"images"}
new_image GET /images/new(.:format) {:action=>"new", :controller=>"images"}
edit_image GET /images/:id/edit(.:format) {:action=>"edit", :controller=>"images"}
image GET /images/:id(.:format) {:action=>"show", :controller=>"images"}
PUT /images/:id(.:format) {:action=>"update", :controller=>"images"}
DELETE /images/:id(.:format) {:action=>"destroy", :controller=>"images"}
내보기 파일 :
<%= link_to "Delete Image", @image, :confirm => 'Are you sure?', :method => :destroy %>
오류 : 나는하지 않는
routing error
No route matches "/images/8"
어디에 오류가 여기에있다, 왜 그것은 단지 이미지입니까?
하하를 파괴 괜찮아, 나는 때로는 :) 문제를 적어 도움이되었다 – tmaximini