Skip to content

Instantly share code, notes, and snippets.

@ryankbales
Created June 19, 2013 18:17
Show Gist options
  • Save ryankbales/5816552 to your computer and use it in GitHub Desktop.
Save ryankbales/5816552 to your computer and use it in GitHub Desktop.
Pull in a custom value based on what page you are on.
<% page_name = params[:page] ? "video_url_#{params[:page]}".to_sym : :video_url %>
<% if @client.stores.first.send(page_name).present? && @client.stores.first.send(page_name) %>
<li class="btn video-btn"><%= link_to "WATCH OUR VIDEO<span class='cta-bottom-icon'>#{image_tag('cta_video_arrow.png')}</span>".html_safe, @client.stores.first.send(page_name), :class => "video", :rel => "shadowbox;height=550;width=600;" %>
</li>
<% elsif @client.stores.first.video_url %>
<li class="btn video-btn"><%= link_to "WATCH OUR VIDEO<span class='cta-bottom-icon'>#{image_tag('cta_video_arrow.png')}</span>".html_safe, @client.stores.first.video_url, :class => "video", :rel => "shadowbox;height=550;width=600;" %>
</li>
<% end -%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment