diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2011-07-12 11:49:58 +0100 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2011-07-12 11:49:58 +0100 |
commit | b514aecf08384f3839db5cdb2274d3748a4402a2 (patch) | |
tree | 5354df8cce23f043bc4cbfac0cdcfc24989550a4 /app/controllers/public_body_controller.rb | |
parent | 0d630ab2c87d925d27879c1cc0db55b0286e46d6 (diff) | |
parent | d5ae493074fa3b71ba517ce34525402f5e59eff0 (diff) |
merge IZ/Kosovo fork and refactor
Diffstat (limited to 'app/controllers/public_body_controller.rb')
-rw-r--r-- | app/controllers/public_body_controller.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb index 4e5bf8ad7..c74959b17 100644 --- a/app/controllers/public_body_controller.rb +++ b/app/controllers/public_body_controller.rb @@ -20,7 +20,10 @@ class PublicBodyController < ApplicationController PublicBody.with_locale(@locale) do @public_body = PublicBody.find_by_url_name_with_historic(params[:url_name]) raise "None found" if @public_body.nil? # XXX proper 404 - + if @public_body.url_name.nil? + redirect_to :back + return + end # If found by historic name, or alternate locale name, redirect to new name if @public_body.url_name != params[:url_name] redirect_to show_public_body_url(:url_name => @public_body.url_name) @@ -70,7 +73,7 @@ class PublicBodyController < ApplicationController render :template => "public_body/view_email" return end - flash.now[:error] = "There was an error with the words you entered, please try again." + flash.now[:error] = _("There was an error with the words you entered, please try again.") end render :template => "public_body/view_email_captcha" end @@ -103,7 +106,7 @@ class PublicBodyController < ApplicationController and has_tag_string_tags.name = ?) > 0', @locale, @tag] end if @tag.size == 1 - @description = "beginning with '" + @tag + "'" + @description = _("beginning with") + " '" + @tag + "'" else @description = PublicBodyCategories::CATEGORIES_BY_TAG[@tag] if @description.nil? |