From: Tom Hughes Date: Fri, 9 Mar 2012 00:28:03 +0000 (+0000) Subject: Drop with_format and user the new :formats render option instead X-Git-Tag: live~5117^2~119 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/82cf356d85154057f840c1b3b413f49a65599690?hp=e660e609661edadc1ed5ad49d6e83e936b2f91cd Drop with_format and user the new :formats render option instead --- diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index dfbb04138..f4b900017 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -137,14 +137,6 @@ module ApplicationHelper end end - def with_format(format, &block) - old_format = @template_format - @template_format = format - result = block.call - @template_format = old_format - return result - end - private def javascript_strings_for_key(key) diff --git a/app/views/note/_note.gpx.builder b/app/views/note/_note.gpx.builder index 8b599eb09..4b9aa9869 100644 --- a/app/views/note/_note.gpx.builder +++ b/app/views/note/_note.gpx.builder @@ -1,8 +1,6 @@ xml.wpt("lon" => note.lon, "lat" => note.lat) do - with_format(:html) do - xml.desc do - xml.cdata! render(:partial => "description", :object => note, :format => :html) - end + xml.desc do + xml.cdata! render(:partial => "description", :object => note, :formats => [ :html ]) end xml.extension do diff --git a/app/views/note/_note.rss.builder b/app/views/note/_note.rss.builder index 49f0a5171..90d575725 100644 --- a/app/views/note/_note.rss.builder +++ b/app/views/note/_note.rss.builder @@ -9,9 +9,7 @@ xml.item do xml.link url_for(:controller => "browse", :action => "note", :id => note.id, :only_path => false) xml.guid url_for(:controller => "note", :action => "read", :id => note.id, :only_path => false) - with_format(:html) do - xml.description render(:partial => "description", :object => note) - end + xml.description render(:partial => "description", :object => note, :formats => [ :html ]) xml.author note.author_name xml.pubDate note.updated_at.to_s(:rfc822) xml.geo :lat, note.lat