In my website toolbar's I would like to display the number of unread messages in a red circle,
So I think the best way is to create a method in ApplicationController named update_notification :
def update_notification
@notification = 42
# 42 is just for test
end
and in application.html.erb, I display :
<%= render :partial => 'messages/notification' %>
_notification.html.erb :
<div id="notification">
<%= @notification %>
</div>
the problem is where and when can I call update_notification method (in ApplicationController ?) and do you think it's the best way to do it like that ?
Thanks