public_activity icon indicating copy to clipboard operation
public_activity copied to clipboard

Trying to return activity text such as "updated ..." in API

Open as-rikoouu opened this issue 2 years ago • 1 comments

I've a requirement where I need to return the activities as a part of my rails API. I looked around at the implementation and looks like the gem relies on the the I18n and renders the actual text like "Updated the OBJECT" from the helper method text here - https://github.com/public-activity/public_activity/blob/1-6-stable/lib/public_activity/renderable.rb#L9. I tried accessing this in the API controller and it didn't work as expected.

Can someone please guide me as to how else I can grab the text the render_activity method renders?

as-rikoouu avatar Mar 07 '22 16:03 as-rikoouu

Please show the code you tried that didn't work. "text" is a method on the instance of activity so you should be able to access it

pokonski avatar Mar 08 '22 15:03 pokonski