Sha256: 9a8a94e7f576bc374dd84313eca0694bd0efb9d0635a895371a85592769155d9

Contents?: true

Size: 1.06 KB

Versions: 1

Compression:

Stored size: 1.06 KB

Contents

module Databases
  
  # ---------------------------------------------------------------------------  
  get "/databases/:page" do
    page       = params[:page].to_i || 1
    path_names = session[:path_names]
          
    @cltns     = options.connection.paginate_db( path_names, page, 10 )
    @title     = title_for( path_names )    
    @back_url  = "/explore/back"
    
    erb :'databases/list'
  end
  
  # ---------------------------------------------------------------------------  
  get "/databases/drop/" do
    path_names = session[:path_names]
    options.connection.drop_db( path_names )
    
    redirect "/explore/back"
  end

  # ---------------------------------------------------------------------------  
  post "/databases/delete/" do
    path = params[:path]    
    
    options.connection.drop_cltn( path )
    
    flash_it!( :info, "Collection #{path.split('|').last} was dropped successfully!" )        
    
    @cltns = options.connection.paginate_db( session[:path_names], 1, 10 )    
  
    erb :'databases/results.js', :layout => false
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mongo3-0.0.4 lib/controllers/databases.rb