Skip to content

Commit

Permalink
Add collaborators expose to Admin::UsersController and remove TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-l-brockwell committed Nov 26, 2024
1 parent aaf94da commit 2585a28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 4 additions & 0 deletions app/controllers/admin/users_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
class Admin::UsersController < Admin::BaseController
before_action :find_resource, except: [:index, :new, :create]

expose(:collaborators) do
@resource.account.collaborators_without(@resource)
end

def index
params[:search] ||= UserSearch::DEFAULT_SEARCH
params[:search].permit!
Expand Down
2 changes: 0 additions & 2 deletions app/views/admin/users/_fields_collaborators.html.slim
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/ TODO collaborators new/delete, also the collaborators variable
- if action_name == "edit"
- collaborators = resource.account.collaborators_without(resource)
- if collaborators.any?
= render "admin/collaborators/list", collaborators: collaborators
- else
Expand Down

0 comments on commit 2585a28

Please sign in to comment.