From e276bea2ff7495b24eedbf3d2594552ba6a4e740 Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 6 Jun 2018 13:34:34 +0800 Subject: [PATCH] Prefer the helper in controllers This avoids future gotchas with conversion to lazy lookups. --- app/controllers/diary_entry_controller.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/diary_entry_controller.rb b/app/controllers/diary_entry_controller.rb index c0b974c5e..f2c11fc74 100644 --- a/app/controllers/diary_entry_controller.rb +++ b/app/controllers/diary_entry_controller.rb @@ -155,8 +155,8 @@ 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) + @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 @@ -167,12 +167,12 @@ 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) + @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") + @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 -- 2.43.2