Sha256: 2227bd4822d44279fcd4d5f83fa9b32963dedef9d00c03ee46b0736567474585
Contents?: true
Size: 742 Bytes
Versions: 4
Compression:
Stored size: 742 Bytes
Contents
module Spree module Api module V1 class ImagesController < Spree::Api::V1::BaseController def show @image = Image.find(params[:id]) end def create authorize! :create, Image @image = Image.create(params[:image]) render :show, :status => 201 end def update authorize! :update, Image @image = Image.find(params[:id]) @image.update_attributes(params[:image]) render :show, :status => 200 end def destroy authorize! :delete, Image @image = Image.find(params[:id]) @image.destroy render :text => nil, :status => 204 end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems