editing for the assets are done with replacable files and description

This commit is contained in:
harrybomrah authored and saurabhbhatia committed 2013-09-11 14:03:13 +08:00
1 parent f920a4f6ba
commit 9e10a3c944
8 files changed
+65 -97

No files matched your search

+2 -9
View File
@@ -32,12 +32,8 @@ class Admin::AssetsController < OrbitBackendController
def edit
@asset = Asset.find(params[:id])
@asset_categories = AssetCategory.all
@tags = get_tags
respond_to do |format|
format.html {}
format.js { render 'js/show_pop_up', :locals => {:partial => 'admin/assets/edit'} }
end
render layout: false
end
def create
@@ -74,10 +70,7 @@ class Admin::AssetsController < OrbitBackendController
def update
@asset = Asset.find(params[:id])
if @asset.update_attributes(params[:asset])
respond_to do |format|
format.html { redirect_to admin_assets_url }
format.js { render 'js/remove_pop_up_and_reload_content', :locals => {:function => 'replaceWith', :id => "asset_#{@asset.id}", :value => @asset, :values => nil, :partial => 'admin/assets/asset', :locals => nil} }
end
render layout: false
else
flash[:error] = t('update.fail')
@asset_categories = AssetCategory.all