Sha256: 1d7fcf3c899bade66b01248a105b8f818d39c01a742d33978e7d09ef1a56f25a
Contents?: true
Size: 1.02 KB
Versions: 15
Compression:
Stored size: 1.02 KB
Contents
module Admin class AssetsController < BaseController sections 'assets' before_filter :set_collections_and_current_collection def new @asset = @collection.assets.build end def edit @asset = @collection.assets.find(params[:id]) end def create @asset = @collection.assets.build(params[:asset]) if @asset.save flash_success! redirect_to edit_admin_asset_collection_url(@collection) else flash_error! render :action => 'new' end end def update @asset = @collection.assets.find(params[:id]) if @asset.update_attributes(params[:asset]) flash_success! redirect_to edit_admin_asset_collection_url(@collection) else flash_error! render :action => 'edit' end end protected def set_collections_and_current_collection @collections = current_site.asset_collections @collection = @collections.find(params[:collection_id]) end end end
Version data entries
15 entries across 15 versions & 1 rubygems