Class: Users::ImagesController
- Inherits:
-
ApplicationController
- Object
- ActionController::API
- ApplicationController
- Users::ImagesController
- Defined in:
- app/controllers/users/images_controller.rb
Instance Attribute Summary
Attributes included from Authentication
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'app/controllers/users/images_controller.rb', line 9 def create # Add validation to limit the file upload current_user.images.attach(params[:file]) ok rescue ActiveSupport::MessageVerifier::InvalidSignature bad_request end |
#destroy ⇒ Object
18 19 20 21 22 23 |
# File 'app/controllers/users/images_controller.rb', line 18 def destroy image = current_user.images.find(params[:id]) image.purge_later ok end |
#index ⇒ Object
3 4 5 6 7 |
# File 'app/controllers/users/images_controller.rb', line 3 def index @images = current_user.images_blobs ok(images: @images) end |