Module: Worthwhile::CurationConcernController

Extended by:
ActiveSupport::Concern
Includes:
Blacklight::Catalog::SearchContext, WithoutNamespace
Included in:
CurationConcern::GenericWorksController, CurationConcern::PermissionsController
Defined in:
app/controllers/concerns/worthwhile/curation_concern_controller.rb

Defined Under Namespace

Modules: ClassMethods

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#actor=(value) ⇒ Object

Sets the attribute actor

Parameters:

  • value

    the value to set the attribute actor to.



73
74
75
# File 'app/controllers/concerns/worthwhile/curation_concern_controller.rb', line 73

def actor=(value)
  @actor = value
end

Instance Method Details

#contributor_agreementObject



30
31
32
# File 'app/controllers/concerns/worthwhile/curation_concern_controller.rb', line 30

def contributor_agreement
  @contributor_agreement ||= Worthwhile::ContributorAgreement.new(curation_concern, current_user, params)
end

#createObject



38
39
40
41
42
43
44
45
46
47
48
# File 'app/controllers/concerns/worthwhile/curation_concern_controller.rb', line 38

def create
  return unless verify_acceptance_of_user_agreement!
  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

#destroyObject



67
68
69
70
71
# File 'app/controllers/concerns/worthwhile/curation_concern_controller.rb', line 67

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

#editObject



53
54
# File 'app/controllers/concerns/worthwhile/curation_concern_controller.rb', line 53

def edit
end

#newObject



35
36
# File 'app/controllers/concerns/worthwhile/curation_concern_controller.rb', line 35

def new
end

#showObject



50
51
# File 'app/controllers/concerns/worthwhile/curation_concern_controller.rb', line 50

def show
end

#updateObject



56
57
58
59
60
61
62
63
64
65
# File 'app/controllers/concerns/worthwhile/curation_concern_controller.rb', line 56

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