engine/app/controllers/admin/assets_controller.rb

31 lines
645 B
Ruby
Raw Normal View History

2010-05-12 00:16:39 +00:00
module Admin
class AssetsController < BaseController
sections 'assets'
2010-05-12 00:16:39 +00:00
before_filter :set_collections_and_current_collection
respond_to :json, :only => :update
2010-05-12 00:16:39 +00:00
def create
create! { edit_admin_asset_collection_url(@asset_collection) }
2010-05-12 00:16:39 +00:00
end
2010-05-12 00:16:39 +00:00
def update
update! { edit_admin_asset_collection_url(@asset_collection) }
2010-05-12 00:16:39 +00:00
end
protected
def begin_of_association_chain
@asset_collection
end
2010-05-12 00:16:39 +00:00
def set_collections_and_current_collection
@asset_collections = current_site.asset_collections
@asset_collection = @asset_collections.find(params[:collection_id])
2010-05-12 00:16:39 +00:00
end
2010-05-12 00:16:39 +00:00
end
end