开发者

ActionView::Template::Error for form field in production (heroku) only

开发者 https://www.devze.com 2023-03-31 02:35 出处:网络
I get the following error when running my application in heroku but it works perfectly in development on my local system.The result field was recently added to the database.I ran heroku rake db:migrat

I get the following error when running my application in heroku but it works perfectly in development on my local system. The result field was recently added to the database. I ran heroku rake db:migrate and saw the new fields being added but the error still persists. It looks like the model wasn't updated to handle the new field.

2011-08-25T00:27:13+00:00 app[web.1]: ActionView::Template::Error (undefined method `result' for #<Test_result:0x0000000405d080>):
2011-08-25T00:27:13+00:00 app[web.1]: 
2011-08-25T00:27:13+00:00 app[web.1]:     9:            <td><%= f.association :project, :include_blank => false %></td>
2011-08-25T00:27:13+00:00 app[web.1]:     11:   <tr>
2011-08-25T00:27:13+00:00 app[web.1]:     10:   </tr>
2011-08-25T00:27:13+00:00 app[web.1]:     12:           <td><%= f.input :result, :collection => ["Pass", "Fail"], :include_blank => false %></td>
2011-08-25T00:27:13+00:00 app[web.1]:     14:   </tr>
2011-08-25T00:27:13+00:00 app[web.1]:     13:           <td></td>
2011-08-25T00:27:13+00:00 app[web.1]:     15:   <tr class="bvt_app_white">

The actual form code is as follows:

   <%= simple_form_for(@test_result) do |f| %>
        <%= render 'shared/error_messages', :object => f.object %>
   <table class="bvt_app_form_table">
        <tr class="bvt_app_white">
        <td><%= f.input :date_run, :label => "Date" %></td>
        <td><%= f.association :project, :include_blank => false %></td>
    </tr>
    <tr>
        <td><%= f.input :result, :collection => ["Pass", "Fail"], :include_blank => false %></td>
        <td></td>

</tr>
    <tr class="bvt_app_white">
        <td><%= f.input :server_rev, :input_html => {:size => 15, :maxlength => 15} %></td>
        <td><%= f.input :client_rev, :input_html => {:size => 15, :maxlength => 15} %></td>
    </tr>
<tr class="bvt_app_white">  
            <td><%= f.input :number_tests, :as => :string, :input_html => {:size => 8, :maxlength => 6} %></td>
            <td><%= f.input :number_passed, :as => :string, :input_html => {:size => 8, :maxlength => 6} %></td>
        </tr>
        <tr class="bvt_app_white">
        <td><%= f.input :number_failed, :as => :string, :input_html => {:size => 8, :maxlength => 6} %></td>
        <td><%= f.input :actual_failed, :as => :string, :input_html => {:size => 8, :maxlength => 6} %></td>
    </tr>
    <tr class="bvt_app_white">
<td colspan=2><%= f.input :false_neg, :as => :string, :label => "False Negatives", :input_html => {:size => 8, :maxlength => 6} %></td>
    </tr>
    <tr class="bvt_app_white">
        <td colspan=2><%= f.input :comments %></td>
    </tr>
    <tr class="bvt_app_white">
        <td><%= f.input :send_email, :as => :radio %></td>
        <td></td>
    </tr>
</table>
    <div class="actions">
        <%= f.submit "P开发者_开发问答rocess Result" %>    
</div>
<% end %>
0

精彩评论

暂无评论...
验证码 换一张
取 消