The problem is that the method error_404inside the controller Defaultcannot process requests in png format. When you ask to say JSON response, you can create a URL similar to:
/controller/action.json
And inside the action you will have something like
def action
respond_to do |format|
format.html
format.json { render :json => @model }
format.xml { render :xml => @model }
end
end
, , JSON XML-, format.png, .png. :
format.png
, :)
Edit
404:
def error_404
respond_to do |format|
format.html
format.png { redirect_to :controller => 'default', :action => 'error_404' }
end
end
:)
Edit2
:
def error_404
respond_to do |format|
format.html { render :not_found_view }
format.all { redirect_to controller: 'default', action: 'error_404' }
end
end
:not_found_view 404. 404 html- self ( html-) .
, :)