Posts

Exporting CSV and Excel File In ROR.

It’s very common now a days to export data from a Web application in CSV or Excel format and in this post i will show how to do that in a Rails application.  Exporting to CSV:- Step:1  /config/application.rb require File . expand_path( '../boot' , __FILE__ ) require 'csv' require 'rails/all' Step:2    /app/controllers/products_controller.rb class ProductsController < ApplicationController def index @products = Product . order( :name ) respond_to do | format | format . html format . csv { render text : @products . to_csv } end end end Step:3  /app/models/product.rb class Product < ActiveRecord : :Base attr_accessible :name , :price , :released_on def self . to_csv CSV . generate do | csv | csv << column_names all . each do | product | csv << product . attributes . values_at( * column_names) end end end end Ste

Push Notifications for IOS and Android In rails 4

APN's :- Apple Push Notification service ( APNs ) is a remote notifications feature provided by apple inc. It is a robust and highly efficient service for propagating information to iOS (and, indirectly, watchOS ), tvOS , and OS X devices. Each device establishes an accredited and encrypted IP connection with APNs and receives notifications over this persistent connection. If a notification for an app arrives when that app is not running, the device alerts the user that the app has data waiting for it. How it works:- The device token you provide to the server is analogous to a phone number; it contains information that enables APNs to locate the device on which your client app is installed. APNs also uses it to authenticate the routing of a notification. The device token is provided to you by your client app, which receives the token after registering itself with the remote notification service. GCM:- Google Cloud Messaging is used to send push notification on android

Twilio apllication step by step process of SMS and Call API in rails

About Twilio:-  Twilio uses   Amazon Web Services   to host telephony infrastructure and provide connectivity between   HTTP   and the   public switched telephone network   (PSTN) through its APIs. Twilio follows a set of architectural design principles to protect against unexpected outages, and received praise for staying online during the widespread  Amazon Web Services  outage in April 2011. Twilio supports the development of open source software and regularly makes contributions to the open-source community. In June 2010 Twilio launched, an open-source product that lets business users configure phone numbers to receive and route phone calls.One month later, Twilio engineer Kyle Conroy released Stashboard, an open-source status dashboard written in the Python language that any API or software service can use to display whether their service is functioning properly or not. Twilio also sponsors Localtunnel, created by now ex-Twilio engineer Jeff Lindsay, which enables softwa