app/views/application/update_caching.js.erb
$('#error_messages').html(<%= flash_block.to_json.html_safe %>);
$('#user_menus').html(<%= render("user_menus").to_json.html_safe %>);
$('head').append(<%= csrf_meta_tags.to_json.html_safe %>);
<% if current_user.try :admin? %>
$('.admin').show();
<% end %>
$('.dropdown-toggle').dropdown();