Class: Mercury::ImagesController
- Inherits:
-
MercuryController
- Object
- ActionController::Base
- MercuryController
- Mercury::ImagesController
- Defined in:
- lib/generators/mercury/install/images/templates/images_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /images.json.
-
#destroy ⇒ Object
DELETE /images/1.json.
Methods inherited from MercuryController
#edit, #resource, #snippet_options, #snippet_preview, #test_page
Methods included from Authentication
Instance Method Details
permalink #create ⇒ Object
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 |
permalink #destroy ⇒ Object
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 |