diff options
Diffstat (limited to 'app/controllers/body_controller.rb')
-rw-r--r-- | app/controllers/body_controller.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/app/controllers/body_controller.rb b/app/controllers/body_controller.rb new file mode 100644 index 000000000..2027e13a1 --- /dev/null +++ b/app/controllers/body_controller.rb @@ -0,0 +1,18 @@ +# app/controllers/body_controller.rb: +# Show information about a public body. +# +# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. +# Email: francis@mysociety.org; WWW: http://www.mysociety.org/ +# +# $Id: body_controller.rb,v 1.1 2007-10-11 22:01:36 francis Exp $ + +class BodyController < ApplicationController + def show + @public_bodies = PublicBody.find(:all, :conditions => [ "short_name = ?", params[:short_name] ]) + if @public_bodies.size > 1 + raise "Two bodies with the same short name: " . params[:short_name] + end + @public_body = @public_bodies[0] + end + +end |