Ruby on rails 联合0.5.5/mongo映射器0.8.6-命名错误(未定义的方法“etag';用于网格…)
我们使用Ruby on rails 联合0.5.5/mongo映射器0.8.6-命名错误(未定义的方法“etag';用于网格…),ruby-on-rails,mongodb,rubygems,mongomapper,etag,Ruby On Rails,Mongodb,Rubygems,Mongomapper,Etag,我们使用 轨道2.3.8 Ruby 1.9.2 Mongo mapper 0.8.6 接头0.5.5 魔杖0.4 在以下代码行中使用etag时,我们会遇到此错误: return if fresh_when( :etag => @lesson.video.etag, :last_modified => @lesson.updated_at.utc ) === 任何帮助都将不胜感激 -MeiMei,请使用hash[]方法获取etag属性: @lesson.video['etag'
- 轨道2.3.8
- Ruby 1.9.2
- Mongo mapper 0.8.6
- 接头0.5.5
- 魔杖0.4
return if fresh_when( :etag => @lesson.video.etag, :last_modified => @lesson.updated_at.utc )
===
任何帮助都将不胜感激
-MeiMei,请使用hash[]方法获取etag属性:
@lesson.video['etag']
Processing LessonsController#video to mp4 (for 127.0.0.1 at 2011-12-22 20:32:51) [GET]
Parameters: {"subdomains"=>["www"], "controller"=>"lessons", "action"=>"video", "id"=>"4ccf79526905582045000041", "format"=>"mp4"}
NoMethodError (undefined method `etag' for #<GridIO _id: 4ccf846a1204cc1b2f0000e9>):
joint (0.5.5) lib/joint/attachment_proxy.rb:32:in `method_missing'
app/controllers/lessons_controller.rb:71:in `video'
class Lesson
include MongoMapper::Document
plugin Joint
(other stuff...)
attachment :image
attachment :video
timestamps!
end