Class: OrdinaryCms::Mercury::ImagesController

Inherits:
MercuryController
  • Object
show all
Defined in:
app/controllers/ordinary_cms/mercury/images_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

POST /images.json



8
9
10
11
12
13
14
# File 'app/controllers/ordinary_cms/mercury/images_controller.rb', line 8

def create

  @image = Mercury::Image.new(params.require(:image).permit(:image))

  @image.save
  respond_with @image
end

#destroyObject

DELETE /images/1.json



17
18
19
20
21
# File 'app/controllers/ordinary_cms/mercury/images_controller.rb', line 17

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