Class: Muck::OaiEndpointsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/muck/oai_endpoints_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



20
21
22
23
24
25
# File 'app/controllers/muck/oai_endpoints_controller.rb', line 20

def create
  @oai_endpoint = OaiEndpoint.new(params[:oai_endpoint])
  @oai_endpoint.contributor = current_user # record the user that submitted the oai_endpoint for auditing purposes
  @oai_endpoint.inform_admin # let an admin know that a global oai_endpoint was added.
  after_create_response(@oai_endpoint.save)
end

#destroyObject



39
40
41
42
43
# File 'app/controllers/muck/oai_endpoints_controller.rb', line 39

def destroy
  @oai_endpoint = OaiEndpoint.find(params[:id])
  @oai_endpoint.destroy
  after_destroy_response
end

#editObject



27
28
29
30
31
32
# File 'app/controllers/muck/oai_endpoints_controller.rb', line 27

def edit
  @oai_endpoint = OaiEndpoint.find(params[:id])
  respond_to do |format|
    format.html { render :template => 'oai_endpoints/edit', :layout => 'popup' }
  end
end

#newObject



14
15
16
17
18
# File 'app/controllers/muck/oai_endpoints_controller.rb', line 14

def new
  respond_to do |format|
    format.html { render :template => 'oai_endpoints/new', :layout => params[:layout] || true }
  end
end

#showObject

pass layout=popup to remove most of the chrome



6
7
8
9
10
11
12
# File 'app/controllers/muck/oai_endpoints_controller.rb', line 6

def show
  @oai_endpoint = OaiEndpoint.find(params[:id])
  respond_to do |format|
    format.html { render :template => 'oai_endpoints/show', :layout => params[:layout] || true  }
    format.json { render :json => @oai_endpoint.as_json }
  end
end

#updateObject



34
35
36
37
# File 'app/controllers/muck/oai_endpoints_controller.rb', line 34

def update
  @oai_endpoint = OaiEndpoint.find(params[:id])
  after_update_response(@oai_endpoint.update_attributes(params[:oai_endpoint]))
end