草庐IT

complaigns

全部标签

ruby-on-rails - 未定义的方法 `each' 为 "#<Complaigns::ActiveRecord_Relation:0x00000003cfb4c8>":String

我有一个名为Complaign的模型,它具有一些其他属性以及投诉日期(c_date)。在ComplaignController中,我有一个indexView,它显示所有的complaigns。有一个从日期到日期的过滤器。过滤后,它工作正常,并正确显示在这些日期触发的投诉。现在我希望将此查询的结果传递给不同的方法,比如导出方法。我想从索引View中传递它,因为它存储在@complaigns中。这是我的索引方法:defindexifparams[:from]&¶ms[:to]from=params[:from].to_dateto=params[:to].to_date@compl