From 82cf356d85154057f840c1b3b413f49a65599690 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Fri, 9 Mar 2012 00:28:03 +0000 Subject: [PATCH 1/1] Drop with_format and user the new :formats render option instead --- app/helpers/application_helper.rb | 8 -------- app/views/note/_note.gpx.builder | 6 ++---- app/views/note/_note.rss.builder | 4 +--- 3 files changed, 3 insertions(+), 15 deletions(-) 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 -- 2.43.2