Respond to .json requests
This commit is contained in:
parent
703ea298d6
commit
b522ef4b69
1 changed files with 24 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue