Sha256: 84c025b52717a55b297ae62dfae661c124f91dcc5f1510869b33a342029be7fa
Contents?: true
Size: 794 Bytes
Versions: 8
Compression:
Stored size: 794 Bytes
Contents
module Imagine class ImagesController < ::ApplicationController before_filter :load_album def show load_image end def new load_new_image end def create load_new_image if ::Imagine::Warehouses::Image.save(@image) redirect_to [@album, @image], :notice => "Image has been attached!" else flash.now[:error] = "There was a problem creating the image." render :action => 'new' end end protected def load_album @album = ::Imagine::Warehouses::Album.find(params[:album_id]) end def load_new_image @image = ::Imagine::Warehouses::Image.new(@album, params[:image]) end def load_image @image = ::Imagine::Warehouses::Image.find(@album, params[:id]) end end end
Version data entries
8 entries across 8 versions & 1 rubygems