Class: CurationConcern::GenericWorksController

Inherits:
BaseController
  • Object
show all
Includes:
Morphine
Defined in:
app/controllers/curation_concern/generic_works_controller.rb

Instance Attribute Summary

Attributes inherited from BaseController

#curation_concern

Instance Method Summary collapse

Methods inherited from BaseController

#authorize_curation_concern!, #contributor_agreement

Instance Method Details

#createObject



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/controllers/curation_concern/generic_works_controller.rb', line 9

def create
  if verify_acceptance_of_user_agreement!
    self.curation_concern.inner_object.pid = CurationConcern.mint_a_pid
    if actor.create
      after_create_response
    else
      setup_form
      respond_with([:curation_concern, curation_concern]) do |wants|
        wants.html { render 'new', status: :unprocessable_entity }
      end
    end
  end
end

#destroyObject



81
82
83
84
85
# File 'app/controllers/curation_concern/generic_works_controller.rb', line 81

def destroy
  title = curation_concern.to_s
  curation_concern.destroy
  after_destroy_response
end

#editObject



56
57
58
59
# File 'app/controllers/curation_concern/generic_works_controller.rb', line 56

def edit
  setup_form
  respond_with(curation_concern)
end

#hash_key_for_curation_concernObject



110
111
112
# File 'app/controllers/curation_concern/generic_works_controller.rb', line 110

def hash_key_for_curation_concern
  curation_concern_type.name.underscore.to_sym
end

#newObject



5
6
7
# File 'app/controllers/curation_concern/generic_works_controller.rb', line 5

def new
  setup_form
end

#showObject



52
53
54
# File 'app/controllers/curation_concern/generic_works_controller.rb', line 52

def show
  respond_with(curation_concern)
end

#updateObject



61
62
63
64
65
66
67
68
69
70
# File 'app/controllers/curation_concern/generic_works_controller.rb', line 61

def update
  if actor.update
    after_update_response
  else
    setup_form
    respond_with([:curation_concern, curation_concern]) do |wants|
      wants.html { render 'edit', status: :unprocessable_entity }
    end
  end
end