class Panel::Gallery::BackEnd::GalleryCategoriesController < OrbitBackendController
	
	def index
		@categorylist = GalleryCategory.all
		@new_category = GalleryCategory.new
	end
	def edit
		@category = GalleryCategory.find(params[:id])
		render :layout => false
	end 
	def create
		@category = GalleryCategory.new(params[:gallery_category])
		@category.save!
		respond_to do |h|
			h.js
		end
	end
	def update 
		@category = GalleryCategory.find(params[:id])
		@category.update_attributes(params[:gallery_category])
		respond_to do |h|
			h.js
		end
	end

	def destroy
		@category = GalleryCategory.find(params['id'])
		@category.delete
		render :json=>{"success"=>"true"}.to_json
	end

end

