Sha256: 9b09142548c8b06f78ecd7f07e07236cfe5f65e2f8779a72f75a48e4257d2f9f
Contents?: true
Size: 423 Bytes
Versions: 5
Compression:
Stored size: 423 Bytes
Contents
class PhotosController < InheritedResources::Base def new @product = Product.find_by_permalink(params['product_id']) || Product.find_by_id(params['product_id']) end def create @photo = Photo.new(params[:photo]) @photo.product_id = params[:product_id] @photo.save! redirect_to :back end def destroy photo = Photo.find_by_id(params[:id]) photo.destroy redirect_to :back end end
Version data entries
5 entries across 5 versions & 1 rubygems