So I am doing this in a Bootstrap dropdown menu in a partial in my main layout:
<% @unread_act.each do |notification| %>
<li>
<%= render_activity notification %>
</li>
<% end %>
@unread_act
is declared in my application_controller.rb
like so:
@unread_act = Notification.where(recipient_id: current_user).includes(:trackable => [:user, :node]).order("created_at desc")
Then in my views/public_activity/comment/_create.html.erb
, I have this:
The issue is that in the dropdown menu, it doesn't display this info. It literally just displays what would be the equivalent of:
activity.trackable.node.name
No idea where it is getting that information, but that's what it is doing.
Any ideas on how I can customize this dropdown menu for my needs?
Also as an aside, I have no idea why the dropdown passes notification
to render_activity
, but the gem still wants activity.trackable
. I tried notification.trackable
but that didn't work.