Class: Mercury::ImagesController
- Inherits:
-
MercuryController
- Object
- MercuryController
- Mercury::ImagesController
- Defined in:
- app/controller/mercury/images_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /images.json.
-
#destroy ⇒ Object
DELETE /images/1.json.
Instance Method Details
#create ⇒ Object
POST /images.json
6 7 8 9 10 11 12 13 14 15 |
# File 'app/controller/mercury/images_controller.rb', line 6 def create @image = Mercury::Image.new @image.size = "300x300" @image.size = params[:size] if params[:size] and !params[:size].empty? @image.image = params.require(:image).permit(:image)[:image] @image.save respond_with @image end |