Class: Cmsimple::ImagesController

Inherits:
Object
  • Object
show all
Defined in:
app/controllers/cmsimple/images_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



16
17
18
19
20
# File 'app/controllers/cmsimple/images_controller.rb', line 16

def create
  @image = Image.new(params[:image])
  @image.save
  respond_with @image, location: new_image_path
end

#destroyObject



22
23
24
25
26
# File 'app/controllers/cmsimple/images_controller.rb', line 22

def destroy
  @image = Image.find(params[:id])
  @image.destroy
  respond_with @image
end

#indexObject



6
7
8
9
# File 'app/controllers/cmsimple/images_controller.rb', line 6

def index
  @images = Image.all
  respond_with @images
end

#newObject



11
12
13
14
# File 'app/controllers/cmsimple/images_controller.rb', line 11

def new
  @image = Image.new
  respond_with @image
end