diff options
author | Francis Irving <francis@mysociety.org> | 2010-10-09 02:28:26 +0100 |
---|---|---|
committer | Francis Irving <francis@mysociety.org> | 2010-10-09 02:28:26 +0100 |
commit | c3ddd34d3d2be0a31640eeb6d3d4ed2876e3c011 (patch) | |
tree | 97d335d01e96edd9c57907ca4427d732dcbc9cc4 /app/controllers/user_controller.rb | |
parent | 0185ddad8ca987a5858fa1781b32948f49729aa1 (diff) |
JSON for user pages.
Diffstat (limited to 'app/controllers/user_controller.rb')
-rw-r--r-- | app/controllers/user_controller.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index e31f91778..288e1cc20 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -52,6 +52,22 @@ class UserController < ApplicationController if @is_you @undescribed_requests = @display_user.get_undescribed_requests end + + respond_to do |format| + format.html { @has_json = true } + format.json { + render :json => { + :id => @display_user.id, + :url_name => @display_user.url_name, + :name => @display_user.name, + :ban_text => @display_user.ban_text, + :about_me => @display_user.about_me, + # :profile_photo => @display_user.profile_photo # ought to have this, but too hard to get URL out for now + # created_at / updated_at we only show the year on the main page for privacy reasons, so don't put here + } + } + end + end # Login form |