Closed nicolasconnault closed 6 years ago
Hi!
The json.jbuilder is just an example. The methods subject, body and url doesn't exist because the solution is up to you. You have to make your own but it can be very simple. In most of our projects we have the subject and body of notifications in our yml locale files.
Actually, you can serialize any information you want depending of the needs of your frontend app.
I have your gem all configured and working, the notifications are being created as they should, and I have access to current_user.notifications. I'd like to display the notifications in my main layout, in FB style with a bell and dropdown menu.
However when I iterate through the notifications, I don't see any methods for accessing the notification's subject, body or URL as they are set up in the json.jbuilder file. Can you please document this with an example?
Merci beaucoup!