aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/body_controller.rb
blob: 2027e13a165a980372efee6448b34b633e4fe10d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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