diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2016-02-29 16:40:57 -0500 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-02-29 16:40:57 -0500 |
commit | b522ef4b690d97ee732f3ce2adc7eedd6b465535 (patch) | |
tree | 86084692122e4c253ca1032c0ebf71b0b4faba36 /app/controllers/users_controller.rb | |
parent | 703ea298d65a455fcb60f3119d0ff94f6a6f16c6 (diff) | |
download | gitlab-ce-b522ef4b690d97ee732f3ce2adc7eedd6b465535.tar.gz |
Respond to .json requests
Diffstat (limited to 'app/controllers/users_controller.rb')
-rw-r--r-- | app/controllers/users_controller.rb | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 6f7021c43fd..bbf92e27aae 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -21,19 +21,40 @@ class UsersController < ApplicationController def groups load_groups - render 'shared/groups/_list', locals: { groups: @groups }, layout: false + respond_to do |format| + format.html + format.json do + render json: { + html: view_to_html_string("shared/groups/_list", groups: @groups) + } + end + end end def user_projects load_projects - render 'shared/projects/_list', locals: { projects: @projects, remote: true }, layout: false + respond_to do |format| + format.html + format.json do + render json: { + html: view_to_html_string("shared/projects/_list", projects: @projects, remote: true) + } + end + end end def user_contributed_projects load_contributed_projects - render 'shared/projects/_list', locals: { projects: @contributed_projects }, layout: false + respond_to do |format| + format.html + format.json do + render json: { + html: view_to_html_string("shared/projects/_list", projects: @contributed_projects) + } + end + end end def calendar |