]> git.openstreetmap.org Git - rails.git/commitdiff
Restrict the fragment caching of the reverse geocode result to only cover
authorTom Hughes <tom@compton.nu>
Sun, 21 Mar 2010 11:33:58 +0000 (11:33 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 21 Mar 2010 11:33:58 +0000 (11:33 +0000)
that lookup and not anything else as the geocode result is only cached once
for all languages.

app/views/diary_entry/_location.html.erb

index ec8ea462a9b7e21e9e79b7c52485d018f0609df0..dfac3a198953bee5a4d55d05093003683ab2e5a1 100644 (file)
@@ -1,11 +1,11 @@
-<% cache(:controller => 'diary_entry', :action => 'view', :display_name => location.user.display_name, :id => location.id, :part => "location") do %>
 <%= t 'diary_entry.location.location' %>
 
 <abbr class="geo" title="<%= number_with_precision(location.latitude, :precision => 4) %>; <%= number_with_precision(location.longitude, :precision => 4) %>">
 <%= t 'diary_entry.location.location' %>
 
 <abbr class="geo" title="<%= number_with_precision(location.latitude, :precision => 4) %>; <%= number_with_precision(location.longitude, :precision => 4) %>">
+<% cache(:controller => 'diary_entry', :action => 'view', :display_name => location.user.display_name, :id => location.id, :part => "location") do %>
 <%= describe_location location.latitude, location.longitude, 14, location.language_code %>
 <%= describe_location location.latitude, location.longitude, 14, location.language_code %>
+<% end %>
 </abbr>
 
 (<%=link_to t('diary_entry.location.view'), :controller => 'site', :action => 'index', :lat => location.latitude, :lon => location.longitude, :zoom => 14 %>
 /
 <%=link_to t('diary_entry.location.edit'), :controller => 'site', :action => 'edit', :lat => location.latitude, :lon => location.longitude, :zoom => 14 %>)
 </abbr>
 
 (<%=link_to t('diary_entry.location.view'), :controller => 'site', :action => 'index', :lat => location.latitude, :lon => location.longitude, :zoom => 14 %>
 /
 <%=link_to t('diary_entry.location.edit'), :controller => 'site', :action => 'edit', :lat => location.latitude, :lon => location.longitude, :zoom => 14 %>)
-<% end %>