2010-07-30 100 views
0

我的系統崩潰了。 日誌崩潰是網站崩潰

:ActionView::MissingTemplate (Missing template public/422.html in view path app/views): 
    app/controllers/application_controller.rb:148:in `check_user' 
    fcgi (0.8.8) lib/fcgi.rb:117:in `session' 
    fcgi (0.8.8) lib/fcgi.rb:104:in `each_request' 
    fcgi (0.8.8) lib/fcgi.rb:36:in `each' 
    dispatch.fcgi:24 

Rendering /home5/cipherte/Portfolio/typetrigger/public/500.html (500 Internal Server Error) 
+0

請提供'application_controller.rb'第148行或'check_user'方法的代碼 – Salil 2010-07-30 11:18:25

回答

0

中創建一個具有以下內容(從標準的Rails)您的項目稱爲public/422.html文件,看看你有多遠,然後

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 

<head> 
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> 
    <title>The change you wanted was rejected (422)</title> 
    <style type="text/css"> 
     body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; } 
     div.dialog { 
      width: 25em; 
      padding: 0 4em; 
      margin: 4em auto 0 auto; 
      border: 1px solid #ccc; 
      border-right-color: #999; 
      border-bottom-color: #999; 
     } 
     h1 { font-size: 100%; color: #f00; line-height: 1.5em; } 
    </style> 
</head> 

<body> 
    <!-- This file lives in public/422.html --> 
    <div class="dialog"> 
    <h1>The change you wanted was rejected.</h1> 
    <p>Maybe you tried to change something you didn't have access to.</p> 
    </div> 
</body> 
</html> 
0

嘗試使用

render :file =>"#{RAILS_ROOT}/public/422.html" 

而不是

render :template =>"public/422.html"