Sha256: 525f59ccf0a9c45824298fe2d80d59229bd51406ed35716d72bb76b72b25c5a7
Contents?: true
Size: 781 Bytes
Versions: 23
Compression:
Stored size: 781 Bytes
Contents
module Spree module Api class ImagesController < Spree::Api::BaseController respond_to :json def show @image = Image.find(params[:id]) respond_with(@image) end def create authorize! :create, Image @image = Image.create(params[:image]) respond_with(@image, :status => 201, :default_template => :show) end def update authorize! :update, Image @image = Image.find(params[:id]) @image.update_attributes(params[:image]) respond_with(@image, :default_template => :show) end def destroy authorize! :delete, Image @image = Image.find(params[:id]) @image.destroy respond_with(@image, :status => 204) end end end end
Version data entries
23 entries across 23 versions & 2 rubygems