Class: Mercury::ImagesController

Inherits:
MercuryController show all
Defined in:
lib/generators/mercury/install/images/templates/images_controller.rb

Instance Method Summary collapse

Methods inherited from MercuryController

#edit, #resource, #snippet_options, #snippet_preview, #test_page

Methods included from Authentication

#can_edit?

Instance Method Details

#createObject

POST /images.json


6
7
8
9
10
# File 'lib/generators/mercury/install/images/templates/images_controller.rb', line 6

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

#destroyObject

DELETE /images/1.json


13
14
15
16
17
# File 'lib/generators/mercury/install/images/templates/images_controller.rb', line 13

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