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"
>
]>
的問題是我怎麼能顯示的信息從對象的想法很簡單:表列字段與新老值。但我非常歡迎看到任何想法如何在視圖中顯示對象的數據,因爲我無法找到如何顯示它