Class: Atrium::CollectionsController
Instance Method Summary
collapse
#atrium_config
#facet_element, #get_parent_path, #get_showcase_parent_edit_path, #get_showcase_parent_show_path, #render_showcase_facet_selection
#application_name
#get_saved_items, #get_saved_search, #saved_searches_for_select
Instance Method Details
#create ⇒ Object
14
15
16
17
18
19
20
21
22
23
|
# File 'app/controllers/atrium/collections_controller.rb', line 14
def create
@collection = Atrium::Collection.new(params[:collection])
if @collection.save
flash[:notice] = "Collection created successfully"
redirect_to edit_collection_path(@collection)
else
flash.now.alert = "Collection not created successfully"
render action: "new"
end
end
|
#destroy ⇒ Object
46
47
48
49
50
|
# File 'app/controllers/atrium/collections_controller.rb', line 46
def destroy
collection.destroy
flash[:notice] = 'Collection '+ @collection.pretty_title+' was deleted successfully.'
redirect_to collections_path
end
|
#edit ⇒ Object
25
26
27
|
# File 'app/controllers/atrium/collections_controller.rb', line 25
def edit
collection
end
|
#index ⇒ Object
6
7
8
|
# File 'app/controllers/atrium/collections_controller.rb', line 6
def index
@collections = Collection.all
end
|
#new ⇒ Object
10
11
12
|
# File 'app/controllers/atrium/collections_controller.rb', line 10
def new
@collection = Atrium::Collection.new(params[:collection])
end
|
#show ⇒ Object
29
30
31
32
33
34
35
|
# File 'app/controllers/atrium/collections_controller.rb', line 29
def show
@exhibits = collection.exhibits
respond_to do |format|
format.html
format.atom { render layout: false }
end
end
|
#update ⇒ Object
37
38
39
40
41
42
43
44
|
# File 'app/controllers/atrium/collections_controller.rb', line 37
def update
if collection.update_attributes(params[:collection])
flash[:notice] = 'Collection was successfully updated.'
else
flash.now.alert = "Collection Not updated"
end
render action: "edit"
end
|