0
我得到错误,而试图创建ics
文件,请查看我的代码什么不对的:未初始化的常量PackagesController :: RiCal
uninitialized constant PackagesController::RiCal
我需要包括或其他什么东西?
def i_cal
pack = Administration::MerchantPackage.find(params[:id])
loc = pack.offering.merchant.address.to_s + pack.offering.merchant.city.to_s
cal = RiCal.Calendar do
event do
description pack.subtitle
dtstart DateTime.parse(pack.start_date.strftime('%m/%d/%Y %H:%M:%S'))
dtend DateTime.parse(pack.end_date.strftime('%m/%d/%Y %H:%M:%S'))
location loc
add_attendee current_user.email rescue ''
alarm do
description "Segment 51"
end
end
end
当我尝试::RiCal.Calendar
它给我的错误:
uninitialized constant RiCal
格式化+语法 –
您的Gemfile中是否有'ri_cal'?你有没有运行捆绑器?之后你有没有重新启动服务器? – BroiSatse
非常感谢,这是错误的。 – shoaib