Class: Workarea::Api::Admin::ProductImagesController
Instance Method Summary
collapse
#current_user, #sort_direction, #sort_field
Instance Method Details
#create ⇒ Object
93
94
95
96
97
98
99
100
|
# File 'app/controllers/workarea/api/admin/product_images_controller.rb', line 93
def create
@image = @product.images.create!(params[:image])
respond_with(
{ image: @image },
{ status: :created,
location: product_images_path(@product.id) }
)
end
|
#destroy ⇒ Object
215
216
217
218
|
# File 'app/controllers/workarea/api/admin/product_images_controller.rb', line 215
def destroy
@image.destroy
head :no_content
end
|
#index ⇒ Object
89
90
91
|
# File 'app/controllers/workarea/api/admin/product_images_controller.rb', line 89
def index
respond_with images: @product.images
end
|
#update ⇒ Object
210
211
212
213
|
# File 'app/controllers/workarea/api/admin/product_images_controller.rb', line 210
def update
@image.update_attributes!(params[:image])
respond_with image: @image
end
|