noesya/osuny

View on GitHub
app/views/admin/communication/blocks/partials/_layout.html.erb

Summary

Maintainability
Test Coverage
<%
layout = block.template.layout
layout_file = "#{file.remove('_show.html.erb')}layouts/_#{layout}.html.erb"
layout_partial =  "#{file.split('app/views/').last.remove('_show.html.erb')}layouts/#{layout}"
%>
<%= render layout_partial, block: block if File.exist?(layout_file)  %>