我正在尝试使用Ruby创建日历,并且该日历在本地可用,但是当我将其推到heroku时会抛出500错误。
这是断行
<%= calendar @date do |date| %>
这是我的控制人
class CalendarController < ApplicationController
before_action :logged_in_user, only: :show
def show
@date = params[:date] ? Date.parse(params[:date]) : Date.today
@nealdocuments = Nealdocument.all
end
end
错误是
at=info method=GET path="/calendar" host=mysite.herokuapp.com request_id=cacc46e7-455e-47d4-81a7-2fa0a1cc1d14 fwd="67.245.106.146" dyno=web.1 connect=0ms service=159ms status=500 bytes=1785 protocol=https
和
2019-06-05T14:41:01.893927+00:00 app[web.1]: F, [2019-06-05T14:41:01.893864 #17] FATAL -- : [cacc46e7-455e-47d4-81a7-2fa0a1cc1d14] ActionView::Template::Error (uninitialized constant CalendarHelper::Calendar
2019-06-05T14:41:01.893930+00:00 app[web.1]: Did you mean? CalendarHelper):
页面加载时没有一行。
这是我的助手类
module CalendarHelper
def calendar(date = Date.today, &block)
Calendar.new(self, date, block).table
end
end