0

我在Heroku的Rails中遇到了与date_select方法有关的问题。Heroku date_select问题Rails 4.2.5

我在我的开发环境和我的生产环境中使用SQLite。

我正在创建一个发票应用程序,我想显示发票的创建日期。在开发中,我可以完美地完成所有工作,而不是生产(Heroku)。

这是我做了什么:

rails g migration AddDateColumnToInvoices date:date 

发票控制器

def invoice_params 
    params.require(:invoice).permit(:date) 
end 

在我的发票_form.html.erb我列出以下几点:

<div class="field"> 
<%= f.label :date %><br> 
<%= f.date_select :date, prompt: { day: 'Select Day', month: 'Select Month', year: 'Select year' } %> 

每当我尝试创建一张新发票时,我总是发现问题出错,但日志并没有真正帮助我疲惫的双眼。

登录样本

2016-06-28T17:51:12.801833+00:00 app[web.1]: app/views/invoices/new.html.erb:3:in `_app_views_invoices_new_html_erb__2241545454872084121_70216351109340' 
2016-06-28T17:51:12.801833+00:00 app[web.1]: 
2016-06-28T17:51:12.801834+00:00 app[web.1]: 
2016-06-28T17:51:12.801826+00:00 app[web.1]:  19: </div> 
2016-06-28T17:51:12.801826+00:00 app[web.1]:  20: <div class="field"> 
2016-06-28T17:51:12.801827+00:00 app[web.1]:  21:  <%= f.label :date %><br> 
2016-06-28T17:51:12.801828+00:00 app[web.1]:  22:  <%= f.date_select :date, prompt: { day: 'Select Day', month: 'Select Month', year: 'Select year' } %> 
2016-06-28T17:51:12.801829+00:00 app[web.1]:  23: </div> 
2016-06-28T17:51:12.801830+00:00 app[web.1]:  24: <div class="field"> 
2016-06-28T17:51:12.778720+00:00 app[web.1]: Started GET "/invoices/new" for IP_ADDRESS at 2016-06-28 17:51:12 +0000 
2016-06-28T17:51:12.801830+00:00 app[web.1]:  25:  <%= f.label :name %><br> 
2016-06-28T17:51:12.801831+00:00 app[web.1]: app/views/invoices/_form.html.erb:22:in `block in _app_views_invoices__form_html_erb___2635260794193137374_70216354097720' 

我还想指出,我已经运行所有必要的迁移等

回答

0

终端

heroku restart 

这就是全部!