Class: Backend::ImageCollectionsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/backend/image_collections_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#breadcrumb, #current_admin, #default_app_locale, #translate_notice

Methods included from Udongo::Cryptography

#crypt

Instance Method Details

#createObject



17
18
19
20
21
22
23
24
25
26
# File 'app/controllers/backend/image_collections_controller.rb', line 17

def create
  @model = ImageCollection.new(allowed_params)

  if @model.save
    redirect_to edit_backend_image_collection_path(@model),
                notice: translate_notice(:added, :image_collection)
  else
    render :new
  end
end

#destroyObject



36
37
38
39
# File 'app/controllers/backend/image_collections_controller.rb', line 36

def destroy
  @model.destroy
  redirect_to backend_image_collections_path, notice: translate_notice(:deleted, :image_collection)
end

#indexObject



5
6
7
# File 'app/controllers/backend/image_collections_controller.rb', line 5

def index
  @image_collections = ImageCollection.order(:description)
end

#newObject



13
14
15
# File 'app/controllers/backend/image_collections_controller.rb', line 13

def new
  @model = ImageCollection.new
end

#showObject



9
10
11
# File 'app/controllers/backend/image_collections_controller.rb', line 9

def show
  redirect_to edit_backend_image_collection_path(@model)
end

#updateObject



28
29
30
31
32
33
34
# File 'app/controllers/backend/image_collections_controller.rb', line 28

def update
  if @model.update_attributes allowed_params
    redirect_to backend_image_collections_path, notice: translate_notice(:edited, :image_collection)
  else
    render :edit
  end
end