Sha256: e02ce9fef42fa72974b487ea735de620c6bc1c9baab9f0e51dd96c741fb15a27
Contents?: true
Size: 766 Bytes
Versions: 17
Compression:
Stored size: 766 Bytes
Contents
Admin.controllers :uploads do get :index, :respond_to => [:js, :json] do @store = Upload.column_store(options.views, "uploads/store") @session_id = options.session_id case content_type when :js then render 'uploads/grid.js' when :json then @store.store_data(params) end end post :create do @upload = Upload.new @upload.file = params[:file] @upload.save render :success => true end delete :destroy, :respond_to => :json do uploads = Upload.all(:conditions => { :id => params[:ids].split(",") }) errors = uploads.map { |upload| I18n.t("admin.general.cantDelete", :record => upload.id) unless upload.destroy }.compact render :success => errors.empty?, :msg => errors.join("<br />") end end
Version data entries
17 entries across 17 versions & 1 rubygems