나는이 guide 다음, 레일 3.2 응용 프로그램에 JQuery와 파일 업로드를 설정하기 위해 노력하고있어 디버깅하는 방법에 대해 설명합니다. 내가 갖는 로그에서게시물 500 내부 서버 오류
POST http://testapp.dev/photos 500 (Internal Server Error)
:
모든 것은 거의 내가가 크롬의 콘솔에 오류가 표시 클릭 "업로드를 시작"할 때 완벽하게 하지만을하고있다
ActionView::MissingTemplate (Missing template photos/create, application/create with {:locale=>[:en], :formats=>[:js, :html], :handlers=>[:erb, :builder, :coffee]}.
컨트롤러를 통해 칫솔질을 해본 적이 있지만이 오류의 원인이나 해결 방법을 찾는 이유를 알아낼 수 없습니다. 이것을 체계적으로 디버깅하는 방법은 무엇입니까?
감사
편집
내 컨트롤러 액션는 다음과 같이 : 그것은 respond_to
블록처럼 보이는
class PhotosController < ApplicationController
def index
@photos = Photo.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @photos }
format.json { render :json => @photos.collect { |a| a.to_jq_upload }.to_json }
format.js { render :json => @photos.collect { |a| a.to_jq_upload }.to_json }
end
end
def show
@photo = Photo.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @photo }
format.json { render :json => @photo }
format.js
end
end
def new
@photo = Photo.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @photo }
format.json { render :json => @photo }
format.js
end
end
def edit
@photo = Photo.find(params[:id])
end
def create
@photo = Photo.new(params[:photo])
respond_to do |format|
if @photo.save
format.html {
render :json => [@photo.to_jq_upload].to_json,
:content_type => 'text/html',
:layout => false
}
format.json { render :json => [ @photo.to_jq_upload].to_json }
format.js
else
format.html { render :action => "new" }
format.xml { render :xml => @photo.errors, :status => :unprocessable_entity }
format.json { render :json => [ {:error => "An error was encountered while processing your photos. Please try again."}], status: 304 }
format.js
end
end
end
def update
@photo = Photo.find(params[:id])
respond_to do |format|
if @photo.update_attributes(params[:photo])
format.html { redirect_to(@photo, :notice => 'Asset was successfully updated.') }
format.xml { head :ok }
format.json { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @photo.errors, :status => :unprocessable_entity }
format.json { render json: @photo.errors, status: :unprocessable_entity }
end
end
end
# DELETE /assets/1
# DELETE /assets/1.xml
def destroy
@photo = Photo.find(params[:id])
@photo.destroy
respond_to do |format|
format.html { redirect_to(photos_url) }
format.xml { head :ok }
format.json { render :json => true }
format.js
end
end
end
아무것도? – Stefan
앱의 로그를 확인 했습니까? 나는 당신의 생산 유형을 모른다. heroku에는'heroku logs' 또는'heroku logs -n 500'이 500 줄을 검색합니다. – jdoe
예, 나는 ActionView :: MissingTemplate이 (템플릿 사진/생성, 응용 프로그램을 누락'받고 있어요 /로 만들 {: 로케일 => [: EN] : 형식 => [: JS : HTML] : 핸들러 => [ : ERB : 빌더, :..? 커피]}'왜는이 부분 –