]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/diary_entry_controller.rb
Return after rendering - stops further processing in controller
[rails.git] / app / controllers / diary_entry_controller.rb
index a3378a4c9c7d2886af91ea5bcd3b488b79228153..f2c11fc741453c2ee3b643ea266eae5682281583 100644 (file)
@@ -155,9 +155,9 @@ class DiaryEntryController < ApplicationController
 
       if user
         @entries = user.diary_entries
-        @title = I18n.t("diary_entry.feed.user.title", :user => user.display_name)
-        @description = I18n.t("diary_entry.feed.user.description", :user => user.display_name)
-        @link = "#{SERVER_PROTOCOL}://#{SERVER_URL}/user/#{user.display_name}/diary"
+        @title = t("diary_entry.feed.user.title", :user => user.display_name)
+        @description = t("diary_entry.feed.user.description", :user => user.display_name)
+        @link = url_for :controller => "diary_entry", :action => "list", :display_name => user.display_name, :host => SERVER_URL, :protocol => SERVER_PROTOCOL
       else
         head :not_found
         return
@@ -167,13 +167,13 @@ class DiaryEntryController < ApplicationController
 
       if params[:language]
         @entries = @entries.where(:language_code => params[:language])
-        @title = I18n.t("diary_entry.feed.language.title", :language_name => Language.find(params[:language]).english_name)
-        @description = I18n.t("diary_entry.feed.language.description", :language_name => Language.find(params[:language]).english_name)
-        @link = "#{SERVER_PROTOCOL}://#{SERVER_URL}/diary/#{params[:language]}"
+        @title = t("diary_entry.feed.language.title", :language_name => Language.find(params[:language]).english_name)
+        @description = t("diary_entry.feed.language.description", :language_name => Language.find(params[:language]).english_name)
+        @link = url_for :controller => "diary_entry", :action => "list", :language => params[:language], :host => SERVER_URL, :protocol => SERVER_PROTOCOL
       else
-        @title = I18n.t("diary_entry.feed.all.title")
-        @description = I18n.t("diary_entry.feed.all.description")
-        @link = "#{SERVER_PROTOCOL}://#{SERVER_URL}/diary"
+        @title = t("diary_entry.feed.all.title")
+        @description = t("diary_entry.feed.all.description")
+        @link = url_for :controller => "diary_entry", :action => "list", :host => SERVER_URL, :protocol => SERVER_PROTOCOL
       end
     end