Showing posts with the label postgres

Download pdf by ajax or javascript or angular js

Click on button for generate pdf  $("#print_selected_label").on("click", function(){    data = []    $("input:checkbox.print_label:checked").each(function(){      data.push($(this).attr("id"));    });   //getting all information of checked checkbox    if(data.length > 0){    // if data is not null       In angular js controller         // var redirect_new = "/admin/v2/orders/print_multiple_label.pdf?" + jQuery.param(data);        // var pdf =, 'Map PDF', '');      By Creating a link by javascript       // var mydiv = document.getElementById("download_pdf");      // var aTag = document.createElement('a');      // var link = " admin/v2/orders/print_multiple_label.pdf?id="+data ;      // aTag.setAttribute('href',link);      // aTag.innerHTML = "link text";      // mydiv.appendChild(aTag);      //; By making http request    

install postgresql 9.5 postgis 2.1 on ubuntu 16.04 || postgis install in ubantu

First you have to install postgres if you have already install then run this command psql --version it return in my system psql (PostgreSQL) 9.6.2  Now we have to install postgis sudo apt install postgis postgresql- your-pg-version -postgis-2.3 in my case sudo apt install postgis postgresql-9.6-postgis-2.3 create extension for your database sudo -u postgres psql -c "CREATE EXTENSION postgis; CREATE EXTENSION postgis_topology;" your_db_name  In my case sudo -u postgres psql -c "CREATE EXTENSION postgis; CREATE EXTENSION postgis_topology;" gisdata Note: Remember before running this command please make sure you have not created extensions in your migration if you created extension in migration file then you must have to skip this command if you run this command by mistake then comment your extension create migration and run your migration file else you will get an error " Extension already created "

An error occurred while installing pg (0.21.0), and Bundler cannot continue

You have to install some additional library to your system to rails setup Open your terminal and run this command- For Linus system sudo apt-get install libpq-dev