diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2011-06-13 16:19:51 +0100 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2011-06-13 16:19:51 +0100 |
commit | 596c9cb37fd2e0d18325f4bdbf25ab3901f9f0af (patch) | |
tree | 4f33d169e26fc3a38452d9d495ee89b62538c443 /app/controllers/public_body_controller.rb | |
parent | 0eb9ef894e8c3353074caf4d39c81830e1ce2dc0 (diff) |
ensure all with_locale calls end with explicit render
Diffstat (limited to 'app/controllers/public_body_controller.rb')
-rw-r--r-- | app/controllers/public_body_controller.rb | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb index 688cfab3d..4e5bf8ad7 100644 --- a/app/controllers/public_body_controller.rb +++ b/app/controllers/public_body_controller.rb @@ -102,13 +102,6 @@ class PublicBodyController < ApplicationController and has_tag_string_tags.model = \'PublicBody\' and has_tag_string_tags.name = ?) > 0', @locale, @tag] end - PublicBody.with_locale(@locale) do - @public_bodies = PublicBody.paginate( - :order => "public_body_translations.name", :page => params[:page], :per_page => 1000, # fit all councils on one page - :conditions => conditions, - :joins => :translations - ) - end if @tag.size == 1 @description = "beginning with '" + @tag + "'" else @@ -117,6 +110,14 @@ class PublicBodyController < ApplicationController @description = @tag end end + PublicBody.with_locale(@locale) do + @public_bodies = PublicBody.paginate( + :order => "public_body_translations.name", :page => params[:page], :per_page => 1000, # fit all councils on one page + :conditions => conditions, + :joins => :translations + ) + render :template => "public_body/list" + end end # Used so URLs like /local/islington work, for use e.g. writing to a local paper. |