Skip to content

Instantly share code, notes, and snippets.

@Soldo
Created April 26, 2012 17:07
Show Gist options
  • Select an option

  • Save Soldo/2501025 to your computer and use it in GitHub Desktop.

Select an option

Save Soldo/2501025 to your computer and use it in GitHub Desktop.
this code in show.html.erb...
<% @page.children.each do |child| %>
<%= link_to(child) do %>
<%= image_tag @page.key_image.url if @page.key_image.present? %>
<h2><%= child.title %></h2>
<% end %>
<% end %>
is producing this output without images:
<a href="/pages/child-page-1">
<h2>Child page 1</h2>
</a>
<a href="/pages/child-page-2">
<h2>Child page 2</h2>
</a>
<a href="/pages/child-page-3">
<h2>Child page 3</h2>
</a>
Even though we're using "@page.key_image.url" href is not showing site domain.
and inside <a> tag there is no image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment