Class: Curate::DepositorsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Curate::DepositorsController
- Includes:
- Sufia::Noid
- Defined in:
- app/controllers/curate/depositors_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/curate/depositors_controller.rb', line 12 def create response = {} unless params[:person_id] == params[:grantee_id] grantor = Person.find(params[:person_id]) :edit, grantor grantee = Person.find(params[:grantee_id]) unless grantor.user.can_receive_deposits_from.include? (grantee.user) grantor.user.can_receive_deposits_from << grantee.user response = {name: grantee.name, delete_path: person_depositor_path(grantor, grantee) } end end respond_to do |format| format.json { render json: response} end end |
#destroy ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'app/controllers/curate/depositors_controller.rb', line 29 def destroy grantor = Person.find(params[:person_id]) :edit, grantor grantor.user.can_receive_deposits_from.delete(Person.find(params[:id]).user) respond_to do |format| format.json { head :no_content } end end |
#index ⇒ Object
9 10 |
# File 'app/controllers/curate/depositors_controller.rb', line 9 def index end |