I am having a content_for block in my application.html.erb as below
<% if alert.present? %>
<%content_for :inline_alert_display do%>
<div class="row" data-snackbar>
<%=render 'components/message', {snackbar_class: 'warning', msg:alert}%>
</div>
<%end%>
<% end %>
and then in sessions/new.html.erb i am calling yield like below
<%= yield :inline_alert_display if content_for?(:inline_alert_display)%>
for what it's worth, i have turbolinks enabled.
But nothing prints.
May be i am missing something, any help to fix this would be great, thanks.
I think you need to reverse it and put ‘yield’ in the template and ‘content_for’ in the view.