diff options
author | francis <francis> | 2007-10-11 22:01:36 +0000 |
---|---|---|
committer | francis <francis> | 2007-10-11 22:01:36 +0000 |
commit | 850ecc72e4467ba6f465a0eaa657bc8d9c7067b2 (patch) | |
tree | 56fdd5fee4ee35c74372290c9b9e3c049d8e672b /app/controllers/body_controller.rb | |
parent | 0b79c30a76cea9d92ef121d66bb905436bfc41ee (diff) |
Added controller for displaying public bodies.
Improve front page.
Tidying up styling a bit.
Add tagline.
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 |