In the setup I have, there is a dropdown responsible for displaying notifications.
<li class="notifications dropdown">
<a class="dropdown-toggle" id="dLabel" role="button" data-remote="true" data-toggle="dropdown" data-target="#" href="/notifications"><i class="icon-user"></i> Notifications</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
</ul>
</li>
Although the ul list inside the dropdown menu is currently empty, the intention is to populate it with Rails data upon clicking the link.
The logic for this action lies within notifications.js.erb:
$(".nav li.notifications .dropdown-menu").remove();
$(".nav li.notifications").append("<%= escape_javascript(render('users/notifications', notifications: @notifications)) %>");
The challenge here is that typically the dropdown link would be set to remote, but due to the implementation of Bootstrap's dropdown functionality, no request is being made to notifications.js.erb. The question then becomes how can we manually trigger the code execution from there?