]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/diary_entry_controller.rb
Set default_url_options for action_mailer
[rails.git] / app / controllers / diary_entry_controller.rb
index 6eb662bd843ec44370700a264b8c8c54eb229ec7..7f5f4fb3ac8bd522578c526bbc95c52adb819854 100644 (file)
@@ -48,7 +48,7 @@ class DiaryEntryController < ApplicationController
 
     if current_user != @diary_entry.user
       redirect_to :action => "view", :id => params[:id]
-    elsif params[:diary_entry] && @diary_entry.update_attributes(entry_params)
+    elsif params[:diary_entry] && @diary_entry.update(entry_params)
       redirect_to :action => "view", :id => params[:id]
     end
 
@@ -157,7 +157,7 @@ class DiaryEntryController < ApplicationController
         @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 = "http://#{SERVER_URL}/user/#{user.display_name}/diary"
+        @link = "#{SERVER_PROTOCOL}://#{SERVER_URL}/user/#{user.display_name}/diary"
       else
         head :not_found
         return
@@ -169,11 +169,11 @@ class DiaryEntryController < ApplicationController
         @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 = "http://#{SERVER_URL}/diary/#{params[:language]}"
+        @link = "#{SERVER_PROTOCOL}://#{SERVER_URL}/diary/#{params[:language]}"
       else
         @title = I18n.t("diary_entry.feed.all.title")
         @description = I18n.t("diary_entry.feed.all.description")
-        @link = "http://#{SERVER_URL}/diary"
+        @link = "#{SERVER_PROTOCOL}://#{SERVER_URL}/diary"
       end
     end
 
@@ -192,13 +192,13 @@ class DiaryEntryController < ApplicationController
 
   def hide
     entry = DiaryEntry.find(params[:id])
-    entry.update_attributes(:visible => false)
+    entry.update(:visible => false)
     redirect_to :action => "list", :display_name => entry.user.display_name
   end
 
   def hidecomment
     comment = DiaryComment.find(params[:comment])
-    comment.update_attributes(:visible => false)
+    comment.update(:visible => false)
     redirect_to :action => "view", :display_name => comment.diary_entry.user.display_name, :id => comment.diary_entry.id
   end