Commit c3098188e925023f45d8e2e1f061fc49b1a08313

Authored by Thiago Ribeiro
1 parent b9cfd5f0

Fix Noosfero.root in highlight_block

Signed-off-by: Thiago Ribeiro <thiagitosouza@gmail.com>
Signed-off-by: Simião Carvalho <simiaosimis@gmail.com>
app/helpers/block_helper.rb
... ... @@ -24,4 +24,8 @@ module BlockHelper
24 24 "
25 25 end
26 26  
  27 + def image_source(image_src)
  28 + Noosfero.root.nil? ? image_src : Noosfero.root + image_src
  29 + end
  30 +
27 31 end
... ...
app/views/blocks/highlights.html.erb
... ... @@ -4,7 +4,7 @@
4 4 <div class='highlights-container'>
5 5 <% block.featured_images.each do |img| %>
6 6 <a href="<%= img[:address] %>" title="<%= img[:title] %>" class="highlights-image-link">
7   - <%= content_tag :img, nil, :src => img[:image_src], :alt => img[:title] %>
  7 + <%= content_tag :img, nil, :src => image_source(img[:image_src]), :alt => img[:title] %>
8 8 <p class="highlights-label"><%= img[:title] %></p>
9 9 </a>
10 10 <% end %>
... ...