再会,
我正在使用这个宝石:Public_activity
宝石文件
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"
>
]>
问题是如何显示来自对象的信息,这个想法很简单:带有列字段和新旧值的表。但是我非常欢迎看到如何在视图中显示来自对象的数据的任何想法,因为我找不到如何显示它