Class: CurationConcern::GenericWorksController

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

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



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

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

#editObject



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

def edit
  setup_form
  respond_with(curation_concern)
end

#hash_key_for_curation_concernObject



100
101
102
# File 'app/controllers/curation_concern/generic_works_controller.rb', line 100

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



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

def show
  respond_with(curation_concern)
end

#updateObject



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

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