2011-03-06 4 views
0

Ruby on Rails 사이트에 Google 문서 뷰어 (http://googlesystem.blogspot.com/2009/09/embeddable-google-document-viewer.html)를 삽입하려고합니다. "죄송합니다.이 유형의 문서는 볼 수 없습니다."라고 계속 표시됩니다. 나는 파일이 전송되는 것을 볼 수 있습니다레일이 달린 Google 문서 뷰어

send_file(File.join(@document.path, @document.filename), {:filename => @document.name, :type => @document.filetype}) 

서버 로그에서하지만, 문서 뷰어가 표시되지 않은 : 내 레일 코드는 다음과 같이 보이는 send_file 전화를 사용합니다. 누구든지이 문제를 해결할 수있는 아이디어가 있습니까?

+0

다른 파일 형식으로 사용해 보시겠습니까? – izzzooo

답변

0

나는 또한 그것을 시도하고있다.

누군가 내 코드에서 도우미와 캘린더를 연결하려고했는데, 이는 캘린더 용이며, 문서 용이 아니지만 아마도 아이디어를 줄 수 있습니다.

def current_user_calendar 
    GCal4Ruby::Calendar.to_iframe(current_user.email, :width => "500", :height => "200", :viewMode => "AGENDA").html_safe 
    end 

    def best_calendar 
    if current_user.can_show?(:system_calendar) 
     id = Settings.calendar_id 
    else 
     id = current_user.email 
    end 
    GCal4Ruby::Calendar.to_iframe(id, :width => "1120", :mode => "week").html_safe 
    end