module Turbo::DriveHelper

def turbo_exempts_page_from_cache

Page that shouldn't be cached by Turbo


<% turbo_exempts_page_from_cache %>
# app/views/trays/index.html.erb

<%= yield :head %><%= yield %>
# app/views/application.html.erb

==== Example

Note: This requires a +yield :head+ provision in the application layout.
Pages that are more likely than not to be a cache miss can skip turbo cache to avoid visual jitter.
def turbo_exempts_page_from_cache
  provide :head, %(<meta name="turbo-cache-control" content="no-cache">).html_safe
end