% if @input.caption? && !@input.caption.blank? %> <%= @input.caption %> <% elsif caption_template? %> <% caption_template = render_caption_template %> <% unless caption_template.blank? %> <%= caption_template %> <% end %> <% end %>