Rails - How can I detect if the content_for content was provided?
I want to detect if content was provided for content_for tag in my template, and if not fall back to default value: <title> <% if content_is_provided -%> <%= yield :title -%> <% else -%> 404 - Page Unknown <% end -%> </title> Any easy way to detect this? I tried <% if :title -%> but that didn't do much. thanks.
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.