0
我使用这个宝石:Public_activity
的Gemfile
在这个模型gem 'public_activity', :git => 'https://github.com/chaps-io/public_activity.git', :branch => '1-6-stable'
然后我跟踪更改:
模型事件
include PublicActivity::Model
tracked owner: Proc.new{ |controller, model| controller.current_user }, params:{ "obj"=> proc {|controller, model_instance| model_instance.changes}}
我检查变量在我的观点:
#<ActiveRecord::Relation [
#<PublicActivity::Activity
id: 21,
trackable_type: "Event",
trackable_id: 8,
owner_type: "User",
owner_id: 13,
key: "event.update",
parameters:
{ "obj"=> { "množství"=>["", "1"],
"updated_at"=>[Thu, 04 May 2017 12:07:25 CEST +02:00, Thu, 04 May 2017 13:36:22 CEST +02:00] }
},
recipient_type: nil,
recipient_id: nil,
created_at: "2017-05-04 11:36:22",
updated_at: "2017-05-04 11:36:22"
>
]>
的问题是我怎么能显示的信息从对象的想法很简单:表列字段与新老值。但我非常欢迎看到任何想法如何在视图中显示对象的数据,因为我无法找到如何显示它