2010-05-12 00:16:39 +00:00
|
|
|
module Admin
|
|
|
|
class AssetsController < BaseController
|
2010-07-23 20:09:54 +00:00
|
|
|
|
|
|
|
sections 'assets'
|
|
|
|
|
2010-05-12 00:16:39 +00:00
|
|
|
before_filter :set_collections_and_current_collection
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2010-07-13 20:01:40 +00:00
|
|
|
respond_to :json, :only => :update
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2010-05-12 00:16:39 +00:00
|
|
|
def create
|
2010-07-13 00:46:17 +00:00
|
|
|
create! { edit_admin_asset_collection_url(@asset_collection) }
|
2010-05-12 00:16:39 +00:00
|
|
|
end
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2010-05-12 00:16:39 +00:00
|
|
|
def update
|
2010-07-13 00:46:17 +00:00
|
|
|
update! { edit_admin_asset_collection_url(@asset_collection) }
|
2010-05-12 00:16:39 +00:00
|
|
|
end
|
2010-07-23 20:09:54 +00:00
|
|
|
|
|
|
|
protected
|
|
|
|
|
2010-07-13 00:46:17 +00:00
|
|
|
def begin_of_association_chain
|
|
|
|
@asset_collection
|
|
|
|
end
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2010-05-12 00:16:39 +00:00
|
|
|
def set_collections_and_current_collection
|
2010-10-07 00:45:41 +00:00
|
|
|
@asset_collections = current_site.asset_collections.not_internal.order_by([[:name, :asc]])
|
|
|
|
@asset_collection = current_site.asset_collections.find(params[:collection_id])
|
2010-05-12 00:16:39 +00:00
|
|
|
end
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2010-05-12 00:16:39 +00:00
|
|
|
end
|
|
|
|
end
|