2011-03-29 45 views
0

我有一款在我的筆記本電腦上工作得很好的應用程序(Ubuntu 10.4),通過了我所有的測試,但是當我把它推到Heroku時會失敗。問題是我有幾個視圖使用複雜的表單從用戶收集數據,並且這些字段的都顯示在Heroku上。我有一個考試對象 - 屬於一個用戶 - 具有許多問題。沒有出現的表單就是用戶可以回答這些問題的地方。有關在Heroku上進行調試的任何提示或技巧將不勝感激。使用複雜的表單部署應用程序到Heroku

這裏是我的工作模型:

exam.rb

class Exam < ActiveRecord::Base 
    belongs_to :user 
    has_many :questions 
    accepts_nested_attributes_for :questions 

question.rb

class Question < ActiveRecord::Base 
    belongs_to :exam 

form.html.erb

<% form_for @exam, :url => put_part1_exam_path(@exam) do |exam_form| %> 
    <%= exam_form.fields_for :questions do |question| %> 
     <p> 
     Value: <%= question.text_field :given_value %> 
     <%= question.object.phrase %> 
     </p> 
    <% end %> 
    <p> 
    <%= submit_tag "Continue" %> 
    </p> 
<% end %> 

回答

0

那麼,答案很簡單。問題出在椅子和鍵盤之間。我忘記了運行rake db:seed任務,它會將信息放入數據庫中,並顯示在表單中。我執行了這個任務,問題就解決了。