Class: Disclaimer::DocumentsController
Instance Method Summary
collapse
disclaimer, #disclaimer_exists?, #disclaimer_has_been_accepted, #host_app_root_path, #redirect_to_disclaimer, #store_disclaimer_return_location
Instance Method Details
#accept ⇒ Object
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
|
#create ⇒ Object
18
19
20
21
|
# File 'app/controllers/disclaimer/documents_controller.rb', line 18
def create
new
update
end
|
#delete ⇒ Object
33
34
|
# File 'app/controllers/disclaimer/documents_controller.rb', line 33
def delete
end
|
#destroy ⇒ Object
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
|
#edit ⇒ Object
23
24
25
|
# File 'app/controllers/disclaimer/documents_controller.rb', line 23
def edit
render :new
end
|
#index ⇒ Object
7
8
9
|
# File 'app/controllers/disclaimer/documents_controller.rb', line 7
def index
@documents = Document.all
end
|
#new ⇒ Object
14
15
16
|
# File 'app/controllers/disclaimer/documents_controller.rb', line 14
def new
@document = Document.new
end
|
#show ⇒ Object
11
12
|
# File 'app/controllers/disclaimer/documents_controller.rb', line 11
def show
end
|
#update ⇒ Object
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
|