From: Tom Hughes Date: Sun, 14 Oct 2012 09:59:51 +0000 (+0100) Subject: Use named routes in note RSS builder X-Git-Tag: live~5175^2~91 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/28b4c624b884c06ef74dc2e86695abaa6cc268c9?ds=sidebyside;hp=361906af9e5a7209af3f7006acbd117ed7b85e24 Use named routes in note RSS builder --- diff --git a/app/views/notes/_note.rss.builder b/app/views/notes/_note.rss.builder index 90d575725..bae719f5f 100644 --- a/app/views/notes/_note.rss.builder +++ b/app/views/notes/_note.rss.builder @@ -7,8 +7,8 @@ xml.item do xml.title t('note.rss.new', :place => note.nearby_place) end - 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) + xml.link browse_note_url(note) + xml.guid note_url(note) xml.description render(:partial => "description", :object => note, :formats => [ :html ]) xml.author note.author_name xml.pubDate note.updated_at.to_s(:rfc822) diff --git a/config/routes.rb b/config/routes.rb index 4c1c637d2..cec2c3e3f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -109,7 +109,7 @@ OpenStreetMap::Application.routes.draw do match '/browse/relation/:id' => 'browse#relation', :via => :get, :id => /\d+/ match '/browse/relation/:id/history' => 'browse#relation_history', :via => :get, :id => /\d+/ match '/browse/changeset/:id' => 'browse#changeset', :via => :get, :as => :changeset, :id => /\d+/ - match '/browse/note/:id' => 'browse#note', :via => :get, :id => /\d+/ + match '/browse/note/:id' => 'browse#note', :via => :get, :id => /\d+/, :as => "browse_note" match '/user/:display_name/edits' => 'changeset#list', :via => :get match '/user/:display_name/edits/feed' => 'changeset#feed', :via => :get, :format => :atom match '/user/:display_name/notes' => 'notes#mine', :via => :get