2010-04-30 3 views
0

사용자 업로드 문서를 Scribd에 보낼 수있는 응용 프로그램이 있습니다. 레일즈에서 scribd_fu를 사용하려고했습니다. 컨트롤러가 모델을 저장하려고 할 때 오류가 발생했습니다.scribd_fu gsub 오류

NoMethodError in DocumentsController#processupload 

private method `gsub' called for nil:NilClass 

여기 아무 잘못이있는 관련 컨트롤러

def processupload 

@document = Document.new(params[:document]) 
if @document.save 
    session[:scribdid] = @document.ipaper_access_key 
else 
    xxxxx 

이며, 이는 관련 HTML 양식

<form action="/documents/processupload" enctype="multipart/form-data" method="post"> 
<input name="authenticity_token" type="hidden" value="FqTCmlGGIvRjiaiaa+YtF50wgI7FfpxfrZsulLCbXcw=" /> 
<label class="label_h2">Upload a Document</label> 
<input id="document_document_upload" name="document[document_upload]" size="30" type="file" /></div> 
<div class="buttons"><button type="submit" class="positive"><img src="/images/icons/tick.png" alt="Save Document"/>Save Document</button> 
</form> 

입니까?

+0

문서 모델 코드를 붙여주십시오. – Salil

+0

클래스 문서는 <액티브 :: 자료 has_ipaper_and_uses '종이 클립' 끝은 내가 그 줄을 주석 경우 모두, 모든 것이 잘 될 것입니다 .... 는 –

+0

당신은 예외 추적을 게시 할 수 있습니까? scribd_fu 보석의 무언가가 오류를 던져야하므로 그 행을 찾으십시오. 실종 된 것에 대해 많은 것을 알려줍니다. – jerhinesmith

답변

1

업로드하려고하는 문서의 MIME 유형이 ScribdFu에서 지원되는지 확인해야합니다. 이것이 대개 오류의 가장 큰 원인입니다. (필자는 ScribdFu라고 적었습니다.)

+0

하이 마, 대답에 대한 감사합니다. 그러나 scribd가 지원해야하는 PDF 파일을 업로드하고 있습니다. 오류를 추적하는 다른 방법이 있습니까? –

+0

감사합니다. 무언가가 마침내 문제를 찾았습니다. 데이터베이스의 클립 클립 설정을 놓쳤습니다. http://github.com/thoughtbot/paperclip –

관련 문제