Class: Disclaimer::DocumentsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/disclaimer/documents_controller.rb

Instance Method Summary collapse

Methods inherited from ActionController::Base

disclaimer, #disclaimer_exists?, #disclaimer_has_been_accepted, #host_app_root_path, #redirect_to_disclaimer, #store_disclaimer_return_location

Instance Method Details

#acceptObject



41
42
43
44
45
# File 'app/controllers/disclaimer/documents_controller.rb', line 41

def accept
  return_path = disclaimer_return_path
  store_disclaimer_acceptance
  redirect_to return_path || host_app_root_path
end

#createObject



18
19
20
21
# File 'app/controllers/disclaimer/documents_controller.rb', line 18

def create
  new
  update
end

#deleteObject



33
34
# File 'app/controllers/disclaimer/documents_controller.rb', line 33

def delete
end

#destroyObject



36
37
38
39
# File 'app/controllers/disclaimer/documents_controller.rb', line 36

def destroy
  @document.destroy
  redirect_to :controller => 'disclaimer/documents', :action => 'index'
end

#editObject



23
24
25
# File 'app/controllers/disclaimer/documents_controller.rb', line 23

def edit
  render :new
end

#indexObject



7
8
9
# File 'app/controllers/disclaimer/documents_controller.rb', line 7

def index
  @documents = Document.all
end

#newObject



14
15
16
# File 'app/controllers/disclaimer/documents_controller.rb', line 14

def new
  @document = Document.new
end

#showObject



11
12
# File 'app/controllers/disclaimer/documents_controller.rb', line 11

def show
end

#updateObject



27
28
29
30
31
# File 'app/controllers/disclaimer/documents_controller.rb', line 27

def update
  params[:document][:segments] = replace_with_segments(params[:document][:segments])    
  @document.update_attributes(params[:document])
  redirect_to document_path(@document)      
end