Posts

Showing posts from 2014

csv file upload progress bar in rails

I have added bootstrap progress bar when uploading csv file. Submit form using Ajax:-       <%= form_for @company, :url=>company_upload_path, :html => {multipart: true,:class=>"upload_form",:remote=>true,:id=>"new_company"} do |f| %>                           <%= file_field_tag "file",:class=>"form-control btn btn-default",:id=>"model_file" %>               <%= f.button 'Import', :class => 'submit  btn btn-primary import_button' %>               <% end %> Add progress-bar div when you want to show progress bar and give its initial width 0. <div class="progress" id = "import-campaign-bar">           <div  class="progress-bar progress-bar-success" style="width: 0%"></div> </div> def company_upload         # @company=Company.import_company(params[:company][:file], params[:tag],current_user,  

pdf in rails

Image
Create PDFs using HTML+CSS. Uses wkhtmltopdf on the back-end which renders HTML using Webkit. You need to install these gems mentioned below : gem install pdfkit gem install wkhtmltopdf-binary Than need to add this line into application.rb : config . middleware . use PDFKit :: Middleware , :print_media_type => true  Now In View you need to add content or whatever you wants to use : download_pdf.html.erb <H1>PDFKit works awesome</H1> This is you HTML data and going to be convert in pdf Than in the controller we need add this: class HomeController < ApplicationController def download_pdf html = render_to_string(:action => '../home/download_pdf', :layout => false) pdf = PDFKit.new(html) send_data(pdf.to_pdf) end end Than you need to add this link to download pdf or you can change as per your conditions : <p id="pdf_link"> <%= link_to "Download (PDF)", home_download_pdf_path(:form

Pull and Push heroku pg database

Pull and Push heroku pg database. 1- gem install pg 2- gem install heroku taps sequel #login to local pg database 3- sudo su - postgres 4- heroku pg:pull HEROKU_POSTGRESQL_MAGENTA mylocaldb --app HerokuAppName HEROKU_POSTGRESQL_MAGENTA=> to know HEROKU_POSTGRESQL_MAGENTA run the following command ' heroku pg:psql' or we can direct access the herku pg database by this command. HEROKU_POSTGRESQL_MAGENTA=> this would be in the following format 'hci-tool:: COBALT' mylocaldb=> your databse name; HerokuAppName=> Your heroku app url PULL example=> heroku pg:pull hci-tool::COBALT hci-tool-new --confirm git@ heroku .com:hci-tool.git PUSH example=> heroku pg:pull  hci-tool-new hci-tool::COBALT --confirm git@ heroku .com:hci-tool.git

jquery map

Image
I find an interesting website where you can get the code of the map in various views and options that can be set. Checkout : http://maplacejs.com/

server crashed in rails4

Image
I have found solution of server crashed in rails4. Keep Debugger gem in development group then your server will never crashed:- Replace:- gem 'debugger', group: [:development, :test] or gem 'debugger' To gem 'debugger', group: [:development]

graph in rails4

Hi you can implement easily graph in rails 4 application.follow this link:- https://google-developers. appspot.com/ chart /interactive/ docs/gallery/linechart

arvind kushwah

Image
arvind kushwah. Hi now i am working in software company as software developer.

arvind kushwah

Arvind kushwah website I have made my first website as url www.arvindkushwah.cu.cc