0
我是ROR編程的初學者,我試着用下面的代碼來做選擇計劃。當我在計算機上執行操作時,我得到了正確的輸出結果,但在heroku中部署後出現錯誤。 這裏dateshedule是Schedule表的列。如何選擇本月的記錄,在rails中使用Active Record Query Interface
def index
if
@schedules=Schedule.where("strftime('%m', dateshedule) = ?", Date.today.strftime('%m'))
else
@schedules = Schedule.all
end
這是在views /時間表/ index.html.erb Schedule for this month
非常感謝,它的工作 –