diff options
author | Francis Irving <francis@mysociety.org> | 2010-10-20 15:53:11 +0100 |
---|---|---|
committer | Francis Irving <francis@mysociety.org> | 2010-10-20 15:53:11 +0100 |
commit | e36720f39d8e8e89f5adf396aa76cd2509574da3 (patch) | |
tree | 9207eec1b257ef681059bf4042267859be82f434 /app/controllers/public_body_controller.rb | |
parent | 095efc46d2a029b4a72a25c0998adc09f8284e5f (diff) |
Factor out some of the JSON generation
Diffstat (limited to 'app/controllers/public_body_controller.rb')
-rw-r--r-- | app/controllers/public_body_controller.rb | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb index dcaaa432c..17eba911f 100644 --- a/app/controllers/public_body_controller.rb +++ b/app/controllers/public_body_controller.rb @@ -50,23 +50,7 @@ class PublicBodyController < ApplicationController respond_to do |format| format.html { @has_json = true } - format.json { - render :json => { - :id => @public_body.id, - :url_name => @public_body.url_name, - :name => @public_body.name, - :short_name => @public_body.short_name, - # :request_email # we hide this behind a captcha, to stop people doing bulk requests easily - :created_at => @public_body.created_at, - :updated_at => @public_body.updated_at, - # don't add the history as some edit comments contain sensitive information - # :version, :last_edit_editor, :last_edit_comment - :home_page => @public_body.calculated_home_page, - :notes => @public_body.notes, - :publication_scheme => @public_body.publication_scheme, - :tags => @public_body.tag_array, - } - } + format.json { render :json => @public_body.json_for_api } end end |