0
我发现code example用于查找当前月份的开始日期和结束日期。我试图跳过启动此代码,但我很难弄清楚我出错的原因。查找月份的开始日期和结束日期
month = params[:month].to_i
date_start = DateTime.new Date.today.year, params[:month], 1
date_end = (date_start >> 1) + 1 # will add a month and a day
@trips = Trip.all :date => date_start..date_end
我不是100%肯定该怎么送入params
。希望有人能帮忙。