Every developer looks for the tools and technology that helps to manage the coding and debugging more flexible. There are many tools available for globally accessing the development work. Here globally accessing development means work in term of our code will be on cloud storage and the user can work from any machine if the internet is available.

There are many options available in the cloud but I would be discussing about AWS(Cloud9).



Amazon Web Services (AWS)


Amazon Web Services (AWS) is a cloud platform provides services and infrastructure from the data center globally.

Millions of customers use AWS to power their infrastructure to become more agile and at effective cost. Customer trust it as it is a more secure cloud computing environment.


AWS Cloud9


AWS Cloud9 is an integrated development environment (IDE) which is cloud-based. It provides the environment to write, run, and debug code from any machine with just a browser. Support software and tools for multiple programming languages like Ruby, PHP, Go, etc.

This reduces the time to setup program in a local development machine. Has sudo privileges and a pre-authenticated AWS CLI while running Cloud9 development environment on AWS EC2 instance. Cloud9 also integrates with AWS CodeStar, providing the tools required to deploy applications to AWS. We can easily access the AWS Cloud9 IDE through a web browser with a built-in terminal.


AWS Cloud9 feature:


1. Fully-featured Editor

It provides a browser-based editor that makes it easy to write, run, and debug your projects. We can select themes for the editor.


2. Broad Selection of Run Configurations

As it supports multiple languages and application type, can set up the custom configuration accordingly environment.


3. Integrated Debugger:

It contains the integrated panel debugger that helps to breakpoint, steps through code, check variables state.


4. Integrated Tools for Serverless Development

Tools like Serverless Application Model (SAM) SAM use as templates in Cloud9 to provide a simplified way of defining resources for your serverless applications.

5. Built-in Terminal

Enables to run commands, like push code changes to git, compiling your code, or displaying command output from servers.

6. Collaborative Editing and Chat

This platform helps to share development environment with a team member. This makes it easy for multiple developers to work in the same code and file too at a time and everyone can view the changes. Cloud9 allows you to use the built-in chat capability to communicate with your team without having to leave the IDE.


How to create and deploy Ruby on Rails application on AWS cloud9


Cloud9 platform is acquired by Amazon Web services. To start with Ruby on Rails application development on Cloud9 required some configuration of AWS account and Cloud9 setting.


Steps to Configure Cloud9 Environment:


1] Create or sign in to the AWS console

2] Configure IAM Groups and Users
a)Create two IAM Groups, Cloud9Admins, and Cloud9Users
b)Cloud9Admins can create new Cloud9 environments and should be assigned to the Cloud9Users group.

c)Sign-in to your AWS console as a Cloud9Admins user.
d)Open Cloud9 from the Services menu.
e)Select Create environment.
f)Enter the Name environment
g)Go to “Configure settings”, Create a new EC2 instance for the environment.
h)Select “next step”
i)Click “Create environment”


Configuration is ready now
Opening the Cloud9 IDE:
1]Open Cloud9 from the Services options.
2]Then click on the Cloud9 environment created. After that will open the AWS cloud9 environment.


Setup Rails Development


Here we can follow the general approach used to build the Rails application. When we select the EC2 instance default configuration added to our cloud9 environment.

In Cloud9 environment, we can create the new rails application as well as can install already built application.

To create a new rails app:

1]Go to the cloud9 terminal

2]mkdir rails_app

3]cd rails_app

4]rvm use ruby-2.6.3@rails_app --ruby-version –create

5] rails new. -T

Above commands will create the rails application.



Run the rails application


AWS Cloud9 contain tools to run a Rails server and preview the application in a browser.

1]Right-click Run available, then select New Run.

2]Run Config Name field and enter rails app name, then start rails s from the Command field of the terminal.

3]Select CWD and choose rails app folder from the given multiple lists.

4]Click on the “Run” button and launch the rails server. Rails server can be started or stop anytime by clicking on the “Run” button.


Preview in Browser

From the main menu, choose Preview => Preview Running Application.

New browser tab will open, click on the pop-out into a new window.

Here you will get the rails application URL opened in a new window.

What is Fabric.js

Fabric.js is a very powerful and simple JavaScript HTML5 canvas library.

Fabric provides an interactive object model on to of canvas element.

Fabric also has a capability to convert the canvas SVG to canvas and canvas to SVG.


What should you do with Fabric.js

Using Fabric.js you can create a populated object on canvas like a simple geometrical shape or complex shapes.

You can upload an image on canvas and perform manipulation on an image like re-size image, rotate

image, apply image filters, etc.

You can add text on the canvas and perform formatting of text, like add font color. Add a text background color, change the font of the text, change the size of the font, etc.

Fabric.js have built-in animation you can easily apply any object of the canvas.

Fabric.js provides a free drawing to create anything you like.

You can save canvas as a png, jpg, SVG and JSON format.


How you can integrate fabric.js into rails application

There is two way to integrate fabric.js into rails application.

1. With the help of ‘fabric-rails’ Gem

2. With the help of Fabric.Js CDN.


With the help of ‘fabric-rails’ Gem

You can easily use fabric.js in rails with the help of ‘fabric-rails’ gem.

gem ‘fabric-rails


With the help of Fabric.Js CDN.

You can add lates version of CDN in your Ruby on Rails application and use fabric.js.

<%=javascript_include_tag "" %>


Create Fabric.js canvas in rails application.

1. Create Rails application

rails new fabric_js_demo_app

2. Add the fabric-rails gem to your Gemfile.

gem ‘fabric-rails

and run bundle install

3. Add fabric.js to your a/assets/javascript/application.js

//= require fabric

4. Create a controller with the index method

rails generate controller home index

5. Add root path for the index method.



6. Add canvas div in app/views/home/index.html.erb file



7. Add the script in .js file to make canvas div as a fabric canvas


8. Now you run rails server and you can show on fabric canvas is display with text.


9. If you want to your canvas object is not move outside the canvas then add the following script.



10. If you want to add a test on canvas then used following script.



JS Script.


11. If you want to upload an image on the canvas. So used the following code.


HTML Code.


JS Script.


12. If you want to convert your canvas into free drawing mode then use the following code.


HTML Code.


JS Script.


13. If you want to convert canvas into an image and download it.


HTML Code.


JS Script.


14. If you want to delete selected object from the canvas.


HTML Code.


JS Script.

You can try fabric.js in your rails application for any application that has a requirement wherein user needs to print any text or image on other objects.






How to use App Proxy in Shopify?

App Proxy:

Sometimes it might be a requirement in Shopify to fetch data from an outside location and display it on the page of an online store. To achieve this kind of requirement, Shopify provides a setting called App Proxy.

An app proxy is a setting that Shopify apps can use to route requests from our Shopify stores shop’s domain to any URL of the other applications.

Here the content on these proxy pages can be dynamic, which allowing it to be updated as often as is needed. App proxies can be used for displaying image galleries, statistics, and custom forms.

It is not necessary to set up app proxies before we publish our app, if we add an application proxy to an app after we have published it, then existing app installations will be updated automatically.

App proxies also support for responses from the Proxy URL using Liquid, which is a Shopify's theme customization engine. This means we can use Liquid to display our proxy page as if it were a part of an online store's theme.


Steps to add an app proxy to any Shopify app:

To add a proxy to our app, we need to make sure the app is set up for the online store area of Shopify for that we’ll need to enable the online store area. Then we can continue with adding the proxy:

1. From the Partner Dashboard, first, we have to click Apps.

2. Click the name of our app.

3. Click on Extensions.

4. Click on Online Store.

5. In the App proxy section, click on Add proxy.

6. Then first we need to select a prefix from the Sub path prefix drop-down list. If required we can add a sub path in the Sub path field:


These settings are required which determines the HTTP request for Shopify that are proxied to the proxy URL entered in the next step. For example, if the sub path prefix is apps, and the sub path is ‘order’, then any path in your shop after is proxied to the provided proxy URL.

7. Need to enter the URL of our proxy server in the Proxy URL field. This is the URL that will be proxied from the path that we entered in the previous step.

8. Finally, click Save.


Quick Example:

Consider the following app proxy configuration settings example:

Subpath prefix: apps

Subpath: my-proxy-app

Proxy URL: proxy_app

In this example, forwards to the proxy URL at



CSS Grid is new layout supported browsers. If we compare to with Bootstrap then CSS Grid does not require to include any external libraries, By adding CSS rules to parent (Grid Container) and to child elements (Grid Items).

CSS Grid is a two-dimensional grid layout, we can work with columns and rows. In comparison to Flexboxes (which is one-dimensional), the CSS Grid layout system provides you to build more complex layouts. It is possible we can use both: Flexbox and Grid Layout in CSS

In Bootstrap Grid Layout system it’s much cleaner to define the layout structure in CSS only. You don't need to include layout definition within your codes. This makes the code easier to read and you are able to quickly adapt the layout if needed without needing to rearrange your code.



grid css


Grid Container

The grid container is the parent element of a grid layout system. The CSS rule display: grid needs to be applied to this container in order to active the CSS Grid layout mode.

Grid Line

Grid lines are the lines which define the structure of the grid and are dividing the grid into cells. Lines in a grid can be either vertically (dividing the grid into columns) or horizontally (dividing the grid into rows).

Each grid line has a unique number starting from 1 on the left side of the grid / on top of the grid. This line numbering is used to define the grid area. You’ll see a practical example later on.


Grid Cell

A grid cell is the smallest unit inside a grid and is the area between two adjacent column grid lines and two adjacent row grid lines.

Grid Area

Inside a grid, a grid area can be any area which is surrounded by four lines. Each area can comprise of any number of cells.

Grid Item

Any direct child elements of the parent grid container are called grid items.


 Defining Grid Column And Rows

grid-template-columns / grid-template-rows

The next step is to define grid columns and rows. This is done by adding CSS properties grid-template-columns and grid-template-rows to the definition of class container:


Location of Grid Items

grid-column-start / grid-column-end / grid-row-start / grid-row-end

So far our example showed that the defined grid elements are put into the grid cells one by another. Each grid item is placed inside one grid cell. You can change the grid item’s location and define that a grid item should span across multiple grid cells by using CSS properties grid-column-start, grid-column-end, grid-row-start, and grid-row-end.

To specify the location with these properties we’re referring to specific grid lines. Remember the lines are automatically numbered starting by 1 (both in a row and column direction).


Browser Support

Since the beginning of 2017 CSS Grid layout support has been shipped with the public released of all majors browsers like Firefox, Chrome, Opera, and Safari.

The IE/Edge version of the specification is prefixed with an -ms prefix and the properties implemented in IE/Edge. This means that the default CSS property names like:


grid-template-columns needs to be changed in IE/Edge to  -ms-grid-columns



First, lets get into what is Shopify?


Shopify is an e-commerce platform for online stores.

Shopify gives us a platform for creating our own online shopping stores.


What is Liquid?

Liquid is an open source template language created by Shopify and which is written in Ruby. All the Shopify themes are built using liquid so we can say it is the backbone of Shopify and is used to load the dynamic content of online stores.

Liquid acts as a bridge between the web layout and the website data.

Basically, a template language makes it possible to re-use the static elements that define the layout of a webpage, while dynamically loading the pages with data from a Shopify store. The static elements are of-course written in HTML, and the dynamic elements are written in Liquid.


How does Liquid work with Shopify?


1. User requests a URL of a Shopify store in the browser.


2. Shopify works out to find which store is being requested.


3. For the requested store, Shopify selects the required liquid template from the active theme directory.


4. The liquid content place-holder is replaced with the real data stored on the Shopify platform for the requested e-Commerce website.


5. After that, the compiled HTML file is sent to the browser.


6. The browser processes the HTML file and fetches all other required assets(images, JS, CSS, etc.) files.

Liquid Syntax:


Liquid code can be categorized mainly into three things: Objects, Tags, and Filters.



  • For displaying any object and or any variable name, we can use the output tag denoted by {{ …. }} double curly braces.

  • For example, we can display the title of a page using {{ page.title }}. Here, Liquid is rendering the value of the object with the name page.title.

  • Objects uses the dot syntax in-order to fetch any properties of an object.


  • Tags are used to create the logic and control flow part for the templates.

  • The {% …. %} curly braces with a percent sign are used to denote a logic.

For example:


If the user is logged in and his name is Jay, then the above code will display - Hello Jay


  • Liquid filters are used to modify the output of any numbers, strings, objects, and variables.

  • They are denoted by a pipe character “ | ” and are placed within an output tag {{ }}.

For example:


Liquid Collections:

  • Liquid collection is different from product collection. Generally, a bunch of products that are grouped together logically is called a product collection and in Liquid, a collection is the number of objects that are all the same.

  • Example: Collection of product images, etc



Liquid is a powerful template language while working on the Shopify platform. And its similarity with HTML and ability to load the dynamic data makes it a great choice to create eCommerce websites with Shopify.


Introduction to ElasticSearch:

Elasticsearch is an open-source full-text search, real-time distributed engine. Developed on Java programming language, which enables Elasticsearch to run on different platforms.

Accessible from RESTful web service interface for querying and indexing massive amounts of structured data.

Elasticsearch can also be used as a data store engine.


General Feature:

Elasticsearch is scalable up to petabytes of structured and unstructured data. It can be used as a replacement of document stores like MongoDB where all the data store in a document.

The good thing about ElasticSearch is that, it an open source platform and available under the Apache license version 2.0.

Elasticsearch uses denormalization to improve the search performance.


Elasticsearch Advantages:

Elasticsearch is real time, in other words, after one second the added document is searchable in this engine. It is distributed from the cluster, which makes it easy to scale and integrate into any big organization.

Elasticsearch provides JSON objects as responses, which makes it possible to invoke the Elasticsearch server with a large number of different programming languages.

It also provides the feature of backup the data. Creates full backups easily by using the concept of the gateway.


Installation of ElasticSearch in Linux OS:

To begin, run the following command to import the Elasticsearch public GPG key into APT:

1]wget -qO - | sudo apt-key add -


2]echo "deb stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list


3] sudo apt update

4] sudo apt install elasticsearch


Open the file for configuration


5] sudo nano /etc/elasticsearch/elasticsearch.yml

Add localhost

6] sudo systemctl start elasticsearch


7] To enable Elasticsearch to start up every time your server boots:

sudo systemctl enable elasticsearch


8] Test whether your Elasticsearch service is running by sending an HTTP request:


Run command on terminal

curl -X GET "localhost:9200”

Output will get in response:


{ "name" : "ZlJ0k2h", "cluster_name" : "elasticsearch", "cluster_uuid" : "beJf9oPSTbecP7_i8pRVCw", "version" : { "number" : "6.4.2", "build_flavor" : "default", "build_type" : "deb", "build_hash" : "04711c2", "build_date" : "2018-09-26T13:34:09.098244Z", "build_snapshot" : false, "lucene_version" : "7.4.0", "minimum_wire_compatibility_version" : "5.6.0", "minimum_index_compatibility_version" : "5.0.0" }, "tagline" : "You Know, for Search" }


Domain where we can use the ElasticSearch:

We can use the ElasticSearch where we have a huge amount of datasets and search data easily. Blog search document, E-commerce product sites, Geosearch data feature are the some domain where we can use the ElasticSearch.


Indexing in Elasticsearch:

Let’s say I have created an article in database

article#1 -> “global article"

article#2 -> “rails article"

article#3 -> “ruby on rails"


An inverted index for these records will be like this:


global -> article#1

article -> article#1, article#2

ruby-> article#3


In the inverted index,article#1 article#2 are the indices for ElasticSearch data. Now, searching for the word “article” uses the inverted index and return article#1 and article#2 directly.


Integration of Elasticsearch in Rails:


For integrating ElasticSearch, I created one rails application where simply implemented Article creation with fields Article title and content of the article. Also added one search form where I can search the text related to Articles.

To start using ElasticSearch add gems in Gemfile:


gem 'elasticsearch-model'

gem 'elasticsearch-rails’


Then we have to make the elastic search in the model we want to implement global search like below:


require 'elasticsearch/model'

class Article < ActiveRecord::Base

include Elasticsearch::Model

include Elasticsearch::Model::Callbacks




query: {

multi_match: {

query: query,

fields: ['title^10', 'text']






settings index: { number_of_shards: 1 } do

mappings dynamic: 'false' do

indexes :title, analyzer: 'english'

indexes :text, analyzer: 'english'




Article.__elasticsearch__.client.indices.delete index: Article.index_name rescue nil


# Create the new index with the new mapping

Article.__elasticsearch__.client.indices.create \

index: Article.index_name,

body: { settings: Article.settings.to_hash, mappings: Article.mappings.to_hash }


# Index all article records from the DB to Elasticsearch



To create the indices in a model where a search will be execute ElasticSearch provide the method:




To delete the indices use



There are many features provided by the ElasticSearch like keyword Analyser to search any text data using the keyword.


Peatio is an open source cryptocurrency exchange web application. Here you will be going to have your own cryptocurrency exchange. For the installation of Peatio, you should have a fresh Ubuntu system along with minimum 4GB RAM and 1 TB SSD.



Now Start with the installation of following technology stack required for the peatio configuration and installation.

  1. Redis server

  2. RabbitMQ

  3. MySQL database

  4. Bitcoind

  5. Nginx with Passenger

  6. JavaScript Runtime


Step 01: Install Redis with a stable version

Redis is basically used in peatio for storing session data as well as trading data, that needs to be transferred from one application to another.

sudo apt-get update

sudo apt-get install redis-server


Now you can configure the redis.conf file as per the requirements

sudo nano /etc/redis/redis.conf


Step 02: Install RabbitMQ Server

RabbitMQ is used for exchange the data between servers, applications, and processes.
It uses the Advanced Message Queuing Protocol (AMQP) to exchange the data between peatio and the coin servers like bitcoind, ethereum, rippled, etc.


Install the rabbitmq-server by using the following commands.


sudo apt-get update

sudo apt-get install rabbitmq-server


To start the rabbitmq-server first enable the rabbitmq management plugin and then restart it.


sudo rabbitmq-plugins enable rabbitmq_management


sudo service rabbitmq-server restart


Same like above command we can use start, stop and status for checking the status of rabbitmq-server.


Step03: Install MySQL Database

Here we are going to install the mysql database.

sudo apt-get update

sudo apt-get install mysql-server mysql-client libmysqlclient-dev


Step 04: Installation and Configuration of Bitcoind Server


Bitcoind is a program or daemon which implements bitcoin protocols for remote procedure call (RPC).
When the Bitcoind get installed in the Ubuntu system, it started syncing blocks of blockchain of Bitcoin. Once the difference between the current block and synced block is getting the same then we can make transaction form our local system.


First, install the dependencies then install bitcoind server.

sudo apt-get update

sudo apt-get install bitcoind



Here we can configure the bitcoind server for testnet as well for real Bitcoin network.

mkdir -p ~/.bitcoin

touch ~/.bitcoin/bitcoin.conf

nano ~/.bitcoin/bitcoin.conf


Now insert the following lines into the bitcoin.conf file and replace with your ’s rpcuser and rpcpassword.






# If run on the test network instead of the real Bitcoin network










# Notify when receiving coins


walletnotify=/usr/local/sbin/rabbitmqadmin publish routing_key=peatio.deposit.coin payload='{"txid":"%s", "currency":"btc"}'


Now we can start bitcoind server using the following command or we can use bitcoin-cli for further operations.




Step 05: Nginx Installation

Nginx is an open-source web server which is used for low memory uses and high concurrency. It handles the high numbers of connections and acts as a load balancer to manage traffic and distribute it.

sudo apt-get update

sudo apt-get install nginx

sudo ufw allow 'Nginx HTTP'

systemctl status nginx


Now configure the default config file to setup Nginx with reverse proxy

open file ‘/etc/nginx/sites-available/default’ in an editor and replace the file content with the following








# Make sure to add the next line to /etc/hosts.






server {


server_name http://localhost:3000;


listen 80 default_server;




location ~ ^/(?:trading|trading-ui-assets)\/ {


proxy_pass http://localhost:5000;






location / {


proxy_pass http://localhost:3000;








Make sure to replace http://localhost:3000 with your actual server.


You can verify the syntax of the config file is valid or not.




sudo nginx -t


and then restart the nginx server


sudo systemctl restart nginx


Step 06: Install JavaScript Runtime

The JavaScript Runtime is used for assets pipeline to work.


curl -sL | sudo bash -


sudo apt-get install nodejs


Installation & Configuration of Peatio

First, take the clone of peatio form GitHub


mkdir cryptocurrency_exchange


cd cryptocurrency_exchange


git clone


cd peatio


use rvm 2.5.1


bundle install


now prepare the configuration files




install and run the yarn


npm install -g yarn


bundle exec rake tmp:create yarn:install


Setup bitcoind rpc endpoints


Edit ‘config/seed/currencies.yml’


Replace ‘username:password’ and ‘port’


remember username:password should only contain letters and numbers not email address as a username.


Setup database for peatio


Edit ‘config/database.yml’ replace your database username and password. And run the commands.


bundle exec rake db:create


bundle exec rake db:migrate


bundle exec rake currencies:seed


bundle exec rake markets:seed


Run daemons

in the peatio directory


god -c lib/daemons/daemons.god


you can use commands like god start, god restart and god status daemon


Setup Authentication


By default peatio uses the google authentication, you can also use barong for the authentication.
Change the sign in provider as per your requirement in “/config/application.yml”


Run Peatio

Here we can start the server and run the Peatio application.

bundle exec rails s -p 3000


Here we can see the Peatio is running now.


A few clients ask us for what good reason we utilize Ruby on Rails to create web applications rather than the various web systems and languages. There are numerous purposes behind our choice, yet before I leave on an exchange of the favorable circumstances of Ruby on Rails, I should initially clarify what Ruby on Rails really is. 


Rails is a development tool which gives web developers a framework, providing structure for all the code they write.
The Rails framework helps developers to build Websites and Applications because it abstracts and simplifies common repetitive tasks.

Rails is written in Ruby, the programming language which is additionally utilized close by Rails. Ruby is to Rails as PHP is to Symfony and Zend, or as Python is to Django. The intrigue of Ruby to engineers lies in the polish and briskness of the language. 

One of the key standards of Ruby on Rails advancement (from this time forward 'Rails') is tradition over design. This implies the software engineer does not need to invest a great deal of energy arranging records so as to get setup, Rails accompanies a lot of traditions which help accelerate advancement. 

Another characteristic of Rails is the emphasis on RESTful application plan. REST (Representational State Transfer) is a style of programming engineering based around the customer server relationship. It empowers a consistent structure inside applications, which implies they can without much of a stretch be uncovered as an API (Application Programming Interface). 

From a project management point of view, the Ruby on Rails people group advocates Agile Web Development – an iterative improvement technique, that empowers shared and adaptable methodology, which is especially appropriate for Web Application Development with quick evolving prerequisites. 

In the course of the most recent couple of years Ruby on Rails development has picked up a vast and eager after, however, let's consider the fundamental pros of Rails. 


  • The way toward writing computer programs is a lot quicker than with different systems and languages, somewhat as a result of the article arranged nature of Ruby and the huge accumulation of open source code accessible inside the Rails people group. 
  • The Rails traditions additionally make it simple for engineers to move between various Rails ventures, as each task will, in general, pursue a similar structure and coding rehearses. 
  • Rails is useful for Rapid Application Development (RAD), as the structure makes it simple to oblige changes. 
  • Ruby code is truly readable and for the most part self-reporting. This expands efficiency, as there is less need to work out independent documentation, making it less demanding for different designers to get existing ventures. 
  • Rails has built up a solid spotlight on testing, and has great testing systems
  • Rails and the vast majority of its libraries are open source, so unlike other commercial development frameworks there are no licensing costs involved.

Active Job in Rails

26 Feb 2019

Ruby on Rails is the framework that provides the code to build most of the part of the application. When we develop the feature, the job is to write the parts of the application that help to perform a specific task. Ruby on Rails contains different sub-framework to complete feature, one of them is Active Job. When rails application requires to perform the queuing backend job Active Job framework can be used to declare job and make it run.

The active job can be used to send emails, calculate billing, send notifications, scheduled clean-ups. It divides the job in small chunks and runs in parallel. Our effort is to provide the customers with a user-friendly and flexible web application.

This can be approached when server response time is effective. So put jobs that take more time of server to execute in a queue and serve in the backend. Scheduling the task in queue backend distribute traffic on the server by allowing to complete the job when the server is free.

To schedule backend job and run the job resque-scheduler, delayed_job gems can be used.

I worked on the project Google Review management that requires to send the notification to the users whenever there is a new google review comes in application. If I have performed send notification in real time to users that will decrease the response time of server. To achieve this, I found the solution to use Active Job framework.

How to create the Active job in rails?

Active Job framework has a rails generator to create job.

$ rails generate job email_notifier





Above will generate the below structure.

invoke test_unit

create test/jobs/email_notifier_job_test.rb

create app/jobs/email_notifier_job.rb

Created job will be as below

class EmailNotifierJob < ApplicationJob

queue_as :default

def perform(*emails)

# perform notification task



ApplicationJob is the base class for Active Job.

Keep Job in the Queue

1] To enqueue the job to be performed as soon as the queuing system is free.

EmailNotifierJob.perform_later user

2]Schedule job in the queue to be performed tomorrow at noon use

EmailNotifierJob.set(wait_until: Date.tomorrow.noon).perform_later(user)

Execution process of Active Job

To process the queueing backend job in production, need to set up the third party queueing rails library. Rails have its own in-process queuing structure that holds the job in RAM. In case of process crash and resetting system, there can be chances to lost all the scheduled backend task work as default async backend. For backend scheduling, active Job has built-in adapters for multiple queuing backends (Sidekiq, Resque, Delayed Job, Scheduler and others ).

Setup Backend

# config/application.rb

module ReviewApp

class Application < Rails::Application

config.active_job.queue_adapter = :sidekiq




Begin Job in Backend

This job serves the Action mailer’s #deliver_later features which are used to send mails in the background as scheduled. Now a day ’s, it is commonly feature require in web application.

Let us consider the adapter of rails library sidekiq .Method #deliver_later sends emails asynchronously to multiple users. Therefore sidekiq start working using this method after Active job setup. Mailers are queued in the queue mailers.

To start sidekiq processing that enqueue:

bundle exec sidekiq -q default -q mailers

In Job queue to send the notification using actionmailer sidekiq as backend


We can also use other rails adaptor, it depends on the requirement to perform Active job in Rails.

What is E-commerce?

E-commerce i.e electronic commerce or internet commerce is nothing but the process of buying and selling of goods or services, or the transfer of money and data online i.e using the internet or electronic network. From mobile shopping to online payment, e-commerce encloses a wide variety of data, systems, and tools for both online buyers and sellers.


Most businesses with an e-commerce presence in short e-business use an e-commerce store and/or an e-commerce platform in order to conduct both online marketing and sales activities and to supervise plans and fulfillment.


E-commerce platforms are generally of two types:

1. E-commerce webstore with Single-vendor

2. E-commerce Marketplace with Multi-vendor


Types of E-commerce Models:

Generally, there are four main models of e-commerce where almost every transaction between takes place between consumers and businesses can be categorized into:

1. B2C

2. B2B

3. C2C

4. C2B


Let’s look at each type of e-commerce models in a bit more detail.


1. Business to Consumer (B2C):

B2C e-commerce encloses transactions made between a business and a consumer.

It refers to the sale of a good or service to an individual consumer by an individual business.

e.g: You buy shoes from an online shoe retailer.


This is one of the most widely used transaction models in the e-commerce context.


2. Business to Business (B2B):

B2B e-commerce encloses transactions made between businesses, such as a manufacturer and a wholesaler or retailer.

It refers to the sale of a good or service from one business to another business.

e.g: A business sells software-as-a-service (SaaS) for other businesses to use.


3. Consumer to Consumer (C2C):

C2C e-commerce business model is one of the earliest forms of e-commerce model.

It refers to the sale of goods or services between customers.

 e.g: You sell your old furniture’s on eBay or Amazon to another customer.


4. Consumer to Business (C2B):

When a consumer sells their own products or services to a business or organization, this kind of transaction is called C2B.

That is Individual consumers make their products or services available for business buyers.

An example of this would be a kind of business model like iStockPhoto, in which stock photos are available online for purchase directly from different photographers.


Shopify E-commerce Platform:


Shopify is “all in one” e-commerce platform which allows you to build an online store with the great user experience. It’s a fully featured hosted platform which is easy to use and quick to set up.

If you’re looking to sell products online with less experience in web development or coding, Shopify can be the e-commerce platform to achieve this.

Key features of Shopify:

  • Admin/Dashboard: They provide a dashboard/admin.

  • Theme Store: Shopify provides free and paid themes from the Shopify Theme Store to make your store look great.

  • Product Management: In Shopify, Product Management is easy. You can easily add Images from URL, manage variations of your products like product with different sizes or colors.

  • Payments methods: Shopify offers a wide range of payment methods with Shopify Payment which is Shopify's own payment provider to accept credit card payments and you can also choose Third Party Providers i.e. from over 70 credit card payment providers for your store.

  • Marketing & SEO: Shopify offers built-in Search Engine Optimization (SEO) features.

  • Analytics: Shopify provided with built-in analytics that helps you to keep track of your website’s progress over time.

  • 24/7 support: A dedicated Support team available 24/7 to answer your questions.

Shopify provides 14 days trial period, you can try to see how it works for your business. There are different monthly Shopify Pricing Plans, if the merchants located in India, you can see the details here otherwise if they located outside of India, you can click here to see details.

As Shopify is an E-commerce platform (i.e with single-vendor), you can sell your own products online.


You can also convert your Shopify single-vendor app into multi-vendor Marketplace by installing Multi-Vendor Marketplace plugin from Shopify app store into your Shopify app.


So, if you want to sell products on your own E-commerce webstore, I would like to suggest you prefer Shopify.

A cryptocurrency is nothing but a digital currency. Cryptocurrency exchanges are the platforms where you can buy, sell or exchange cryptocurrencies with other digital currency or with other assets such as fiat money. Fiat currency is like paper money for example Rupees, Dollars whose value is decided by the government.


To start with the cryptocurrency exchange, you have to create an account in a cryptocurrency exchange. The exchange will then verify your account. When you want to buy the cryptocurrency, check the asks and when you want to sell the cryptocurrency, check the bids. The ask represents the lowest price sell order that is currently available in the market or the lowest price that someone is willing to go short. The bids represent the highest price buy order that is currently available in the market.


Peatio Cryptocurrency Exchange

Peatio is an open-source cryptocurrency exchange developed in Ruby On Rails framework. You can easily use the Peatio cryptocurrency exchange code as it is freely available to any user.


If you have an interest in the cryptocurrency exchange domain and want to make your own cryptocurrency exchange, you can achieve that easily by making use of the Peatio cryptocurrency exchange.


Peatio is divided into three application i.e Peatio, Barong and Peatio Trading UI.


It’s key features:

  • Register/Login - User can register and login to the exchange.

  • Trading market - the Trading market is the heart of Peatio exchange.

  • Bids and Asks - In a trading market, the user can bid and ask the currencies. It gives the best match for bids and asks.

  • Trade machine-engine – As it has high-performance machine-engine for trading, orders and transactions can take place automatically.

  • Trading dashboard – It shows the data in real time for charts, orders, bids, asks, and markets.

  • Markets – There is a multi-currency market.

  • Orders – When user bid or ask, the order will get created in the exchange and once the price is matched for asks and bid order, the transaction takes place in the exchange.

  • Funds – User can easily deposit/withdraw coins and fiat amount in the exchange.

  • Transaction History – It has a transaction history page which shows the history of the transaction.

  • Admin Dashboard

  • Multiple currency support - There are many currencies supported by Peatio for exchange such as BCH, BTC, DASH, ETH, USD

  • 2FA and KYC – For the user security purpose, 2FA and KYC is developed


Being an open source, you can easily do the customization of UI. You can also customize the functionality of Peatio Cryptocurrency Exchange. I have seen making use of this exchange in an application created by “Cryptex Technologies” who is a ‘Ruby On Rails’ expert.


In Peatio, they have linked three application i.e. Peatio, Barong and Peatio Trading UI together using Nginx reverse proxy setup. They have also customized the UI of Barong, Peatio and Peatio Trading UI. ‘Cryptex Technologies’ have also implemented the browser and the IP address for phishing from which the security can be improved while exchanging cryptocurrency. They have also set up servers like RabbitMQ Event API server, Redis server and MySQL database server which is required for exchanging the Bitcoin.


For more Details Please Visit:



You cannot ignore online marketing, especially when you are a real estate broker or dealer. With potential customers using the Internet to search their future purchase a strong and powerful digital marketing strategy helps real estate brokers and dealers to stand out in the competition.


The industry of real estate has expanded enough where buyers are doing an extensive search online before actually making their final purchase decision. The buyers are searching for brokers, dealers, projects, and sellers online which makes online marketing even more beneficial for the real estate industry.


Some of the advantages of this Real Estate Web Applications are:-

Upload unlimited properties images/videos

● Upload 360-degree virtual tour

Listings with photos and videos

● Get directly connected to the customers

Real-time messaging

● Setup an appointment online

● Search engine with powerful filters

24/7 online presence

● Location awareness and maps


Why real estate application?

You can build your own brand and also build trust among the customers and get directly connected with your prospective customers.


What are the requirements?

One of the biggest reasons many people stay away from investing in an application is believing that it requires advanced technical knowledge and web design experience to build and manage an application. It's quite the contrary.

You don't need any experience to set up your own online application and start investing in digital real estate application get this complete property selling solution in your domain in just 1 DAY with just one click and set up your own brand.

There are options to buy or rent websites.


In conclusion

Eventually, you will start building your brand and connects from the application. Then you can decide whether to sell your application for a profit or to continue to use it. The choice is yours!

Cryptex Technologies is a Real Estate App Development Company which has developed such an application and can set up the application in your domain in just 1 Day.

For DEMO click:


React.js is a Javascript library for building interactive UI application. React.js is very popular nowadays because of its features like performance, virtual DOM, component_based application, etc. After completing development of React.js application next step is to deploy the application on the Production server. There are several ways to deploy React.js application on a production server. We can deploy React.js application using ngnix, apache2, pm2, etc on a production server.


  • The production server instance with Ubuntu 16.04 Operating System.

  • React-project-demo is an already developed project and ready to go live.

1) Deploy React Application using Nginx

Step #1: Installing Environment Dependencies

We’ll need to install node to get working with our React app. The following will do the job to get the latest version of Node at the time of running.

sudo apt-get update

curl -sL | sudo -E bash -

sudo apt-get install -y nodejs

sudo apt-get install -y build-essential

This install Node,
and the build tools that come in handy for npm.

Clone your project repository on Step #2:
server instance

sudo mkdir /var/www

cd /var/www/

Take the clone or paste the code in the current directory, then change the directory:

cd react-project-demo

Install the project on the system:

sudo npm install 

Then you need to create the optimized production build of the project:

sudo npm run build


Step #3: Install and Configure Nginx to serve your application

sudo apt-get install nginx

sudo nano /etc/nginx/sites-available/default

and paste the below code:

server {

listen 80 default_server;

root /var/www/react-project-demo/build;

server_name localhost;

index index.html index.htm;

error_page 404 /;

location / {



Now you need to start your server:

sudo service nginx start

To restart application service:

sudo service nginx restart

To stop application service:

sudo service nginx  stop

You can check the nginx logs in the following files :



2) Deploy React Application using pm2:

pm2 is NPM package, using which one can start react application in detached mode.

Install Node & npm from step #1 of first method, then run following command:

npm i -g pm2 


This installs PM2, aka Process Manager. It’s going to help us handle running our app in the background of your server.


To run the react application:

pm2 start npm -- start 


To check the log of pm2:

pm2 logs


Other useful commands of pm2:

To make sure its running and to check its port number use:

pm2 list


to stop all the running instance of pm2:

pm2 stop all


to save the current running state:

pm2 save


to auto start on machine restarts:

pm2 startup


to disable autostart on machine restarts:

pm2 unstartup


manually restored saved processes:

pm2 resurrect


Similarly, we can use apache2 to deploy our React.js application on the production server.



Capistrano is an automation tool for executing commands on the server through SSH. Capistrano basically a script which provides various commands to execute which helps to deploy the code on the server. It helps to reduce the manual efforts to deploy code and use the same command to deploy code every time. In this document, I am going to describe how to deploy your application from GitHub to the production server.

Capistrano Flow

The Capistrano have main flow as follows:

1. First, you need to install and configure Capistrano in your application.

2. Once the installation and configuration are done every time you have to push the latest code to GitHub and then run Capistrano script to deploy it to the server.


Step 1: Install the following gems in Gemfile.

gem 'capistrano', require: false

gem 'capistrano-rails', require: false

gem 'capistrano-rvm', require: false

gem 'capistrano-bundler'


Step 2: Run following commands to install these gems and initialize Capistrano

$ bundle install

$ bundle exec cap install


Step 3: Capfile

require 'We need to uncomment some lines according to our requirement. As I want to run bundle install automatically I have uncommented line capistrano/bundler'. In the same way for precompiling assets and running migration require 'capistrano/rails/assets' , require 'capistrano/rails/migrations'. As I am using RVM, I have uncommented the line require "capistrano/rvm". Similarly I am using GitHub for code deployment require "capistrano/scm/git"

, install_plugin Capistrano::SCM:: Git.


 Step 4: config/deploy.rb

deploy. In rb file mention name of the application. Then mention GitHub repository path as I have mentioned ‘’.

Mention username and password of your GitHub repository. We also have to connect server where we have to deploy our application with GitHub. For that, we have to enter ssh public key in settings of GitHub so that it will connect GitHub with the server.


Step 5: config/deploy/production.rb

There are two ways to define servers. First one is with simple role-based syntax and another one is extended server based syntax. You should use only one from both, not both of them. In this, we have to set the environment of our rails application like ‘production’. Mention the branch of your code and also the path of application folder on the server in front of ‘deploy_to’.


(b) production.rb

Step 6: Run script

Now, run following command to run the script.

$ cap deploy production


Step 7: Server Setting

In this tutorial, we simply cloned our application code from GitHub to our server. While first time deployment of code it will use a defined directory structure on the server.

1. ‘release’ folder holds all deployments in a folder. Every time you run Capistrano to deploy code, it makes clones GitHub repository to a new subdirectory inside release.

2. ‘current’ folder is a symlink pointing to the latest release inside the releases folder. This symlink will update at every deployment. If deployment fails in any step the current symlink still points to the old release.

3. ‘repo’ folder holds the copy of GitHub repository.

4. shared’ folder contains the configuration which will not be taken from the GitHub repository. As Capistrano deploy works by cloning the GitHub repository into a release It will contain files like (e.g. config/database.yml and config/secrets.yml). You have to put those files in shared and instruct Capistrano to symlink them to release directory on every deploy. This is done through the linked_files and linked_dirs configuration options in deploy.rb file.

Mention the path to the current folder in configuration settings of the server as it contains the latest code from GitHub repository and then restarts the server.I have mention the path like DocumentRoot /home/path/to/your_rails_app/current/public in /etc/apache2/sites-available/application_name.conf file.

  An Introduction to RabbitMQ:

RabbitMQ is a message broker software in Ruby on Rails framework where web applications connect to the queue and transfer a message onto it.

When one application server sends the request to another application server, RabbitMQ works as a queue manager where requests handled and served one by one. 

Message transferring is done from one application to another through RabbitMQ. RabbitMQ uses the standard Advanced Message Queuing Protocol (AMQP) to keep message request in queues and serve easily. The message may contain any information like simple text transfer or task that need to process on another server.

This RabbitMQ software saves messages in a queue and keeps in a queue until receiving application get connected and start processing the messages.

Why should we use RabbitMQ in Ruby on Rails Development?

Message broker works on the producer, broker, and consumer logic. Message broker server allows consumer and producer server to respond request fast instead of using resources heavily at one time. Message broker is used to optimize the load on the server and provide services until application executes the task on the requested server. The requested server can be any third party application which performs the task.

Queued messages will be used to send the messages or task to multiple recipients from consumption that leads to the load balancing on the producer and consumer server.


Let take an example of ruby on rails server and bitcoin exchange server (i.e. bitcoind) for btc transaction working.

I have rails server running as producer and bitcoind server as a consumer.

Rails server send multiple request to bitcoind server continuously. There may be chances to slow down bitcoind because of multiple requests send to bitcoind server to process task.

In that case, RabbitMQ can fulfill the role of load balancing and messages passing by keeping the request coming from rails server in a queue and serve request one by one to bitcoind server.

Bitcoind server will take a task from the queue and start processing.                                                           

RabbitMQ with Ruby on Rails for Web Application Development               

AMQP role in RabbitMQ:

AMQP store and forward messages to consumers, same as SMTP protocol which is used to deliver mail to mailboxes. Messages start from producer application to the exchanges that help to redirect in queues. Lastly, queues deliver task to the consumer application. It's now consumer's server responsibility to take the messages from queues to process as required. 

A virtual channel is used to establish the connection between publishing messages from the queue. All process exchanges done over the channels.

How to use RabbitMQ in Rails application?

Using Bunny ruby RabbitMQ client, we can integrate RabbitMq with rails application. There are some gems available to start with RabbitMQ in ruby like

gem “bunny”


Bunny help rails application to interoperate with the consumer application, it can be built in any technologies irrespective of the size and complexity of the application. Also, add anampq gem in rails Gemfile to use AMQP protocol services.

   gem  ‘amqp’


RabbitMQ installation commands in Ubuntu:

1] Step 1: Update system

sudo apt-get update

2] Step 2: Install Erlang

RabbitMQ is written in Erlang, you need to install Erlang before you can use RabbitMQ:

a] wget
 b] sudo dpkg -i esl-erlang_20.1-1\~ubuntu\~xenial_amd64.deb

3] Step 3: Install RabbitMQ

      sudo apt-get installrabbitmq-server


4] Step 4: Start the Server

   sudo systemctl start rabbitmq-server.service
   sudo systemctl enable rabbitmq-server.service


Thus if you are looking for web development services which is faster, reliable, redundant and scalable then you can definitely opt for Ruby on Rails RabbitMQ. Hire RoR developers for developing a robust messaging software.




Action Cable is a powerful feature introduced in Rails 5. Using action cable one can develop real-time web applications. Action cable uses Web Sockets to create full duplex communication between application’s server and client.


Using action cable feature we can create any real-time functionality like live chatting, which updates chats, show new messages, notifications, etc without reloading of the page. Action cable basically keeps ruby on rails server data and client data updated using web sockets which make the application more feasible to use.


Action cable is not supported by RAILS VERSION > 5.




This ruby gem requires jQuery. If jQuery is not present in the project then simply add “jquery_rails” gem to gemfile.rb and redis-server in the system.




Add following in Gemfile.rb file :


gem 'redis', '~> 4.0'


Also add following in application.js file :

//= require rails-ujs

//= require jquery

//= require turbolinks

//= require_tree

Thats all about installation process.


Let’s see an EXAMPLE :

For creating Notification model, controller and views using scaffold command just run :


rails g scaffold Notification name:string


Then create a Channel , we call this channel “WebNotifications”.

rails generate channel WebNotifications


And we add some CoffeeScript files to show notifications to all users in javascripts/ = App.cable.subscriptions.create "WebNotificationsChannel",

received: (data) ->

$('#notification div').append '<li>' + data['notification'] + '</li>'

$('#notifications-count,.notifications-count').text data['count'] 


And finally we need to add the below code to the channels web_notifications_channel.rb.


class WebNotificationsChannel < ApplicationCable::Channel

def subscribed

stream_from "web_notifications_channel"


def unsubscribed



Changes in notifications_controller.rb file To call the action cable: 
def create

@notfication =

respond_to do |format|


format.html { redirect_to @notfication, notice: 'Notfication was successfully created.' }

format.json { render :show, status: :created, location: @notfication }


format.html { render :new }

format.json { render json: @notfication.errors, status: :unprocessable_entity }



ActionCable.server.broadcast 'web_notifications_channel', notification:, count: Notification.all.count


Changes in app/views/layouts/application.html.erb file : I have added simple notification navigation in the application layouts.

<ul class="nav navbar-nav navbar-right">

<li class="dropdown">

<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Notification (<b class="notifications-count">2</b>)</a>

<ul class="dropdown-menu notify-drop">

<div class="notify-drop-title">

<div class="row">

<div class="col-md-6 col-sm-6 col-xs-6">Notifications (<b id="notifications-count">2</b>)</div>

<div class="col-md-6 col-sm-6 col-xs-6 text-right"><a href="" class="rIcon allRead" data-tooltip="tooltip" data-placement="bottom" title="tümü okundu."><i class="fa fa-dot-circle-o"></i></a></div>



<!-- end notify title -->

<!-- notify content -->

<div class="drop-content" id="notification">

<% Notfication.all.each do |notification| %>


<div class="col-md-3 col-sm-3 col-xs-3">

<%= %>



<% end %>





We need to do simple configuration setup in the cable.yml file.

redis: &redis

adapter: redis

url: redis://localhost:6379/1

production: *redis

development: *redis

test: *redis

To start the application first we need to start the redis-server the command to start the redis-server is:


The Redis-server will be started then you can serve your application.
Following are the snapshots of output scenarios:


Creating new Notifications:


Introduction to Action Cable in Rails 5


The result will be shown like that By using the action cable it will update the Notification to all live users.


Ruby on Rails Action cable tutorial



In Ruby on Rails web development, using Action Cable RoR developers can show the live notifications to all users. These notifications can be of any type like Messaging, Sending push notification etc.

As software testing is moving from manual into automation at very fast speed, at times testers get into a scenario where they need to opt what needs to be automated, when to automate and why to opt for automated software testing?


If you are a software tester, this blog will help you to choose one from the two testing methods.


Software testers generally perform manual testing in the following scenarios:



1. When an application is at the initial stage of development. As application flow and feel and change over developing period it's better to go for manual testing then automating it. Automation can be done only when the application is stable.


2. When negative testing of the application is to be done because it's more reliable to depend on manual testing.


3. When regression is not required multiple times i.e. there are no multiple executions of test cases.


4. When there are some functionalities which cannot be automated like Captcha.




What is Automated Software Testing?


It is a process in which specific tools are used to execute scripts or test and compare the results. There are various tools available in the market to automate different types of software testing like QTP, Selenium, etc.


Starting with automation first need to take in consideration the following to avoid any confusion.


  • Is the build stable?

  • Does the application requires testing same functionality many times(Regression/Sanity/Smoke)

  • Will writing automated test case save time?

  • Do we have that much time to invest in automated testing?



If the answer to this question is YES then you can opt for automation testing for the application. Choosing the right framework for application is all dependent on what you are going to test.


And yes a team of experts for software testing to carry out the process is really important aspect followed by proper planning and strategy.


When to Choose Automated Software Testing?


1. Regression Testing: When we need to test the same test case or functionality multiple times. As testing the same functionality manually make people bore and error chances increase.


2. Large No. of Test Cases: When there is a large number of test cases to execute, it’s better to go with automation where just running the test suite will solve the problem.


3. Time management: As said above executing a large number of test cases manually will take a lot of time and money. So the time can be saved if we are using automation testing.


4. Performance: It's not possible to invest thousands of users to test the performance of any application. Automated testing can generate the required amount of user to interact with application and network.


5. Accuracy: It can be obtained with the help of regression/sanity/smoke testing: one has to just run the script. Manually there is a chance of missing any scenario.


Nowadays, data handling is a big responsibility for every web and mobile application. Arrays make the process easier and it can handle any list of data. Once you have data in an array, you can easily sort it, remove duplicates, change its order to either ascending or descending and many more.


In Ruby programming, there are many methods for Array object i.e. Map, Collect, Select, Reject, Each, Inject, Reduce, Detect and Find. Most of the Ruby on Rails developers uses these methods in their web applications.


In this blog, we have outlined the difference between all the methods.


Let’s have a look at them to choose the one which is best suitable for your requirement.


1. Map


The map method takes each element from the array and evaluates
given block on it. Output will be in the form of an array containing evaluated results without changing the original array.


Array Methods in Ruby



2. Map!


If you want to modify the original array by replacing the output array elements with the original array elements then you can use the map! method.


Ruby Methods for Array



3. Collect


There is no difference between collect and map method both methods work same. Similarly map! and collect! methods are also same.



Array Method in Ruby on Rails



4. Select


The select method takes each element from the array and evaluates given block on it. If block or statement evaluates to true the original elements gets added into the output array. In this case output array and original array are different. If you want to replace the original array to the output array, you can use select! Method.


Array Methods in Ruby Programming



5. Reject


The reject method is exactly opposite to the select method. It will take each element of the array in the block to evaluate. The output array will consist of all the elements in the original array for which block evaluates to false. The reject! method is also opposite to the select! method.


Array Method in Ruby on Rails Programming


6. Each


The each method will iterate over array taking each element from it for evaluation. It will return the original array, but not evaluated one. Now, it depends on you what kind of operation you want to perform in the block.


How to use Ruby Methods in Arrays



7. Inject


The inject method takes two arguments, one as an accumulator and other as each element in the array. Accumulator accumulates the evaluated values. This returns the final value of the accumulator as a result. The initial value of the accumulator can be defined if not define it takes the first element of the array as initial value.



Ruby on Rails Programming Developers uses this Array Methods



8. Reduce


Reduce method is similar to the inject method.


Reduce Method in Ruby for Arrays



9. Detect


The detect method is similar to the select method, but the only difference is its output. The detect method also evaluates a block for each element of the array, but returns the first element in the array for which the block evaluates to true or statement in the block evaluates to true.


Ruby on Rails Programming with Arrays



10. Find


Find method is similar to Detect method.


Ruby on Rails Development and Array Methods





If you want to create Rails Application dependent on API only and you have a requirement to provide Token based authentication in your application. So you can use JWT+ KNOCK token based Authentication solution.


Knock is an authentication solution for Rails API-only application based on JSON Web Tokens.

JWT is JSON based web tokens.


Advantages of using JWT and Knock in Ruby on Rails Application:


  • JWT:


1. It is lightweight

2. It is easy to use

3. It is stateless


  • Knock:


1. Seamless JWT authentication for Rails API

2. It is easy to implement and maintain.

3. It allows customization.


Step 1: Create Rails API Project


rails new project_name --api -d mysql 



# --api specifies the rails application is API based

# -d mysql specifies that we use mysql database in this application


Step 2 : Add gem


Add following gem into project_name/Gemfile


gem 'knock' 

gem 'jwt'


gem file looks like


Token Authentication in Rails Application

Figure 1: Gemfile for JWT and Knock


Next to run command on terminal for installing gem in application.

bundle install 


Step 3. Setup a basic Knock structure.


Run following command


rails generate knock:install 

rails generate knock:token_controller user


Now run the following commands to setup your Rails application.


rails generate model users 

rails generate controller users 

rails generate controller home



If you add custom model so you can do it


File Location: project_name/db/migrate/:random_number_create_users.rb


Migration file in Ruby on Rails Application

Figure 2: Migration File


Run following command to create User table


rake db:migrate 


Step 4 . Authorization/Knock Setup:


File Location: project_name/config/initializers/knock.rb


Knock Setup in Rails Application

Figure 3: Knock.rb file


Step 5. Setup your User model with some basic validation.



File Location: project_name/app/model/user.rb



Your user model look like this.


Knock and JWT in Rails Application

Figure 4: User.rb file


Now you can setup controller to access the Authentication.


Add include Knock::Authenticable 


File Location: project_name/app/controller/application_controller.rb


Application Controller in Rails Application

Figure 4: Application Controller

Also each and every method call pass though knock authentication.


Add before_action :authentication_user, only[:auth]


Here auth is a method to check client is authorized.


In home controller there is index method and auth method for login.


File Location: project_name/app/controller/api/v1/home_controller.rb


Home Controller | Ruby on Rails Developer

Figure 6: Home Controller


File Location: project_name/app/controller/api/v1/users_controller.rb

In user controller there is index, current method for current user data and create method for creating new user. Also you can add update and delete method.


Add authentication on required method with help of authentication_user , authorize_as_admin, and authorize method.


User Controller in Ruby on Rails Application

Figure 7: User Controller

Final Step: Test API


We test API with help of Postman.


1. User creation API: API endpoint is http://localhost:3000/api/v1/users/create


We send parameter in body for user creation so that API method type POST. After calling API we get successful response with status 200 and and message “User was created ”.


After user creation we go to login API, but for application login we need a token so we need to call token API.


User Create API - Rails Application | Token Authentication


Figure 8: User create API



2. API Endpoint: http://localhost:3000/api/v1/user_token


For user token we need to send email id and password in body of method type POST.


If email id and password is valid to API we get jwt token from knock in response.


Great we now got token. With help of this we access knock authorized method.


User Token API - Rails Application Development

Figure 9: User_token API


3. Login API:


API Endpoint: http://localhost:3000/api/vi1/auth


we sent jwt token in header of API and content type is applicationJson.


Authentication: Bearer jwt token

content type: : applicationJson.


If everything is OK, then we get successful response.


Rails Application - Token Based Authentication API

Figure 10: Login with jwt token


These two gems Knock + JWT can help us to develop token based API in Rails 5 very easily and will save the overall time required in Ruby on Rails development.

In this blog we will discuss about Unit Testing, the very first thing that we need to know is when the Unit Testing is being performed. Unit testing is the initial level of software testing, that is performed on the application source code mainly by the developer. The main motive of Unit Testing is to isolate a section of code and verify it’s correctness.


What is Unit Testing:


A level of software testing where the individual units or components of a software or web applications are tested by developer is called Unit Testing. It is an important aspect of Software Testing. It is a component of test-driven development (TDD).


Benefits of Unit Testing:


1. Defects revealed by a unit test are easy to locate and relatively easy to repair. Unit testing verifies the accuracy of the each unit.


2. In unit testing procedure – the developer needs to write test cases for all functions and methods so that whenever a change is required, it can be fixed quickly in later date and the module also works correctly.


3. Unit testing improves the quality of the code. It helps the programmer to write the better code. It identifies every defect that may have come up before code is sent further for regression testing.


4. If a test fails, then only the latest changes need to be made in the code and need to debug. So It’s better to say unit testing helps to simplify the debugging process.


5. Codes are more reusable. In order to make unit testing possible, codes need to be modular. This means that codes are easier to reuse.

Unit Testing in Ruby on Rails Software Development


Gems to perform Unit Testing in your Ruby on Rails web application:


There are several gems available in Ruby on Rails application framework to perform the unit testing.


  • rspec_rails: Rspec is an automated test case, used to test the code written by developer while creating the application.

  • factory_girl_rails: create dummy data while performing testing.

  • minitest: It is also used to perform the unit testing in your rails application.


These 3 gems given above are used for Test Driven Development (TDD) environment.


  • database cleaner: Used to cleanup the database in Ruby while testing.


Most of the Ruby on Rails Developers use the best practices for carrying unit testing on individual units of source code or program modules.


Unit Test Case Best Practices:


  • You Should always follow the proper naming conventions for your unit testing, i.e. clear and consistent naming conventions for the unit tests.


  • If any changes done in the requirements then your unit test case should not be affected. Your test cases should be independent.


  • Always follow “test as your code" approach. The more code you write without testing, the more paths you have to check for errors.


  • If any changes needs to done in the code for the corresponding module, make sure that you have the unit test case for that particular module and need to pass the test case before any implementation done.




Developer should make Unit testing a part of their regime to make neat and clean, reusable, and bug free codes. Also by using unit testing the quality of code will be improved. Unit testing helps to reduce the cost of bug fixes.

We have gone through many web applications and mobile applications which do not reload the entire page but instead reloads only the required section. These are nothing but Single Page Applications (SPA) which are developed using Angular. A good example of SPA is Gmail where we have noticed that when we click on the inbox, it only reloads and displays that email in the e-mail list sections.

Introduction to Angular:

Angular is a TypeScript-base open-source front-end platform and framework led by the Angular Team at Google used for building client-side web applications. Angular itself is written in TypeScript, which is a superset of JavaScript and used for front end development.


In order to start with the installation, we first need to make sure that we have nodejs and npm installed with the latest version.

We can install nodejs on Ubuntu OS by running the following command on terminal:

  • sudo apt-get update

  • sudo apt-get install nodejs

To install npm, we run the following one-line command on terminal:

  • sudo apt-get install npm

To check the versions of Node.js and npm installed, we run following command:

  • nodejs –v

  • npm –v

Let’s install Angular CLI by running the following command:

  • npm install –g @angular/cli

IDEs for Angular:

We can use any of the IDE i.e., WebStorm, Atom, Visual Studio Code, etc. But usually, Visual Studio Code is preferred.

Architectural Blocks of Angular:

The main building blocks of an Angular application are:

  • Modules

  • Components

  • Templates

  • Metadata

  • Data binding

  • Directives

  • Services

  • Dependency injection

In this blog, we will have an overview of Angular Modules and Angular Components.

Angular Modules:

We have Angular modules or we can say NgModules which maintains the modularity of Angular apps. Every Angular app has at least one module as the root module. Conventionally, it is named as AppModule. Typically, an app contains many functional modules. In angular, any module is a class with the @NgModule decorator.

The NgModule decorator is a function that takes metadata object whose properties describe the module. The properties are as follows:

  • declarations: Here, we have to declare the classes that are related to views (i.e. The components, the directives, and the pipes that belong to this NgModule).

  • exports: Here, we have to mention the classes that should be accessible to the components of other modules.

  • imports: Here, we have to mention the modules whose classes are needed by the component of this NgModule.

  • providers: Here, we have to mention the Services present in one of the modules which are to be used in the other modules or components. Once a service is included in the providers it becomes accessible in all parts of that application

  • bootstrap: Here, we have to mention the root component which is the main view of the application. This root NgModule only has this property and it indicates the component that is to be bootstrapped.

The root module (i.e. src/app/app.module.ts) by default looks like:


Angular | A JavaScript Framework for Front End Development

Image: The Root Module in Angular


Angular Components

Every Angular application has a root component i.e. AppComponent which is bootstrapped inside the main module. In angular, each component defines a class with the application data and logic and is associated with a view i.e. HTML template to be displayed in a target environment.

The root component (i.e. src/app/app.component.ts) by default looks like:


Angular | A JavaScript Framework for Front End Development








Image: The Root Component in Angular


Advantages of Angular:

  • Angular is faster, lighter and easier framework which is built to create faster performance applications that are smaller in size and easier to develop.

  • It provides high performance, offline, and zero-step installation. So, Angular is pretty much easy to work with.

  • Angular is universal that means we can use any technology with it for serving the application like node.js, .NET, PHP, Ruby on Rails and other servers.

  • Angular is productive as:

  • It generates UI templates quickly with simple and powerful template syntax.

  • Angular CLI with Command line tools.

Apart from front end development we use Ruby on Rails framework for backend development. Hope this blog would be informative to understand the basic building blocks of Angular.

Introduction to FontAwesome 5:


Font Awesome 5 is upgraded version of Font Awesome 4, It has a more attractive icon with big improvement icons as compare to Font Awesome 4

Some improved points are listed below:


  • FontAwesome 5 icons are drawn now with SVG.


  • Now we have to reference Javascript file with SVG embedded in place of CSS file ( In FontAwesome 4 we use CSS file only ).


However, version 5 is now redesigned and rewritten from scratch.


Now, Let us see the changes in FontAwesome 5


Different icon styles:


In Version 5, there are 3 different styles:

i) Solid Style

ii) Regular Style

iii) Light Style


“Brand Icons” are separated out into their own style and is easy to use. Version 4 had one prefix only “-fa” and Version 5 has four prefixes. To set a style of any icon with ease, every prefix has different Javascript and SVG file. If we want to use them, we need to import Javascript and SVG file. Some as mentioned below.


Font Awesome 5 Prefix

Icon Style

JS+SVG Filename

Web Font


Font Awesome Brands



fas or fa

Font Awesome Solid




Font Awesome Regular




Font Awesome Light




Table: Font Awesome 5 Details




Version 4’s Syntax


1)<i class=”fa fa-rocket”></i>


Version 5’s Syntax


1)<i class=”fas fa-rocket”></i>-----------“fas ‘s’ for Solid”

2)<i class=”far fa-rocket”></i>----------- “far ‘r’ for Regular”

3)<i class=”fal fa-rocket”></i>----------- “fal ‘l’ for Light”


Note:- Some Icon name changed in the upgraded version.


How to use FontAwesome 5:


Step1: Add Assets for FontAwesome 5 (Version 5)


Download cdn which is required for version 5


Web Font & CSS files


  1. css/solid.css

  2. css/regular.css

  3. css/brand.css

  4. css/fontawesome.css

  5. css/light.css

  6. For all CSS, we can use css/all.css


JS & SVG files


  1. js/solid-.js

  2. js/regular.js

  3. js/brand.js

  4. js/fontawesome .js

  5. js/light.js

  6. For all js, we can use js/all.js


There is one more file that is “ Shims ” file.

Shim file is created to be used as band-aids until you get time to upgrade. Version 4 allows you to keep v4 icon name, aliases, and syntax while mapping Version 5. If we want to use then add below extra line to our Version 5


<link rel=”stylesheet” href=””>


v4-shim is used for both Web Fonts + CSS and SVG + JS Frameworks.

If we want to use new and fancy SVG+JS of rendering icon, then switch the “css/all.css” into “js/all.js” also “css/v4-shims.css” into “js/v4-shims.js“


Step2: Add syntax in your HTML file


For Example:

<i class=”fal fa-rocket”></i>

<i class=”far fa-rocket”></i>

<i class=”fas fa-rocket”></i>


An effect you can see in below image:


FontAwesome 5 in Web Designing


Image: Font Awesome 5 Comparison


Note: In FontAwesome 5 some icon name are changed, if we don’t want to use them then, we have to add shim file. Version 5 has lots of icon but some icons are paid, if we want to use then we need to buy PRO Version .




1) Icon are designed using SVG and Javascript.

2) Icon Fonts are Ligatures and auto-accessibility.

3) Icon can be re-written, redesigned using CSS and JS.

A scheduled task is very important in Ruby on Rails application. Ruby on Rails does not have this type of “out-of-the-box” feature, but we can use the Cron job to achieve the purpose. Cron can be scheduled to send a reminder email, or scheduling to crawl something from another website on daily basis. In this blog, let’s quickly go through how to use Cron job.

What is CRON?

Cron task is a time-based job scheduler in Unix-like computer operating systems. Cron can be used to schedule jobs to run periodically at fixed times, dates, or intervals. Cron is most suitable for scheduling repetitive tasks in Ruby on Rails applications.

Let’s take an example of sending a daily digest email to persons or users. In this case, we might have a mailer like this using crontab:


#STEP 1.

The user can run any method from the terminal. Here I’m running an action inside a model i.e schedule_rb_method.

Open “app/models/reminder.rb” and then add the method for running an action as shown below.


Cron Job in Ruby on Rails Application


Run rails runner “Reminder.schedule_rb_method” command inside the project path on the terminal, to check method is running or not.


#STEP 2.


Set the default rvm to the project.

run rvm --default use 2.5.0


#STEP 3.


Creating a Crontab:

Cron is driven by a crontab (cron table) file, a configuration file that specifies shell commands to run periodically on a given schedule.

Users can have their own individual Crontab files in the system.

It’s pretty easy to start working with cron jobs in rails. You can start editing your cron tasks using the crontab command on your terminal:

Open your terminal: run crontab -e

This command will open a text file in your terminal’s default editor.


#STEP 4.


We are going to enter a line into this crontab file. It will have the following structure:

[timings] [switch to your app directory] && [path to ruby] script/runner -e [environment] “[model class name] . [ (run method name) path to cron log]”

By looking at the above line to understand: Run a task every day at 10 am.


Rails Cron Job Tutorials for Beginners


  1. If you try and save your crontab and you receive errors, make sure the whole command is in one line on your terminal.

  2. If your model method runs OK, you should either get some mail as mentioned in the cron. However, if there is an error, you must check your cron method to check the log you created in rails to understand the error.


Crontab Syntax:

Once you’re in the editor, you can start creating and editing cron tasks in rails. To schedule a cron task, you need to define when the task will run, then define the command to trigger that task.

There are 5 variables that can be changed inside a cron task in Ruby on Rails application:

  • 1st variable: Minute, which can be specified from 0 to 59 min

  • 2nd variable: Hour, which can be specified from 0 to 23 hr

  • 3rd variable: Day of Month, which can be specified from 1 to 23 day

  • 4th variable: Month, which can be specified from 1 to 12 month

  • 5th variable: Day of Week, which can be specified from 0 - 6 (Sunday = 0) week days

If the variable is a “*” it means for all.

If the variable is a series of number split by a comma “,”, it means OR condition on each of the specified number in Cronjobs.



Timing Format: 
minute   hour   day   month   weekday
0 30      *      *      *      *   example command to be executed


Cron job Crontab in rails application


While cron jobs are useful and can get the job done in many instances, you should be careful in your decision of how to implement scheduled and delayed tasks in Ruby on Rails application.

In rails, Cronjobs are best for tasks that are not highly critical or essential to your application’s functionality or performance. They should also execute in a reasonably short amount of time so that they don’t bog down your rails server(s).


Every University has thousands of applications streaming in for each course. A single application has a minimum of three stages – the document submitted by the student, his/her interview and finally, uploading the financial proof. Managing all of this singularly is a huge challenge.

There is a strong need for providing a common platform for application management. Offshore System for Student Management, a software developed and managed by Cryptex Technologies, India is the perfect one-stop solution for this. This application is developed using Ruby on Rails technology.

It is integrated with a dashboard showcasing the various features of this application, you can easily navigate around to make your work easier.

The dashboard has options for viewing the student application checklist, interview scheduling and feedback, advanced search functionality, along with the financial document submission and COE.

A database of a thousand and more entries can be filtered according to the search requirement. You can generate reports for specified time durations in the form of graphs and charts.

An export data feature is introduced in this to export the online data directly to your desktop.

Another added feature of OSSM is that of accessing the information of the agent via whom the student has applied. This helps during future decision making, giving a constructive insight into the work done by each of the agents.

Having a consolidated application for admission procedure is a one-time solution for eliminating all the manual efforts and errors.


Student Management Software using Ruby on Rails


Contact us if your needs are similar to this and we will build a smooth student management platform for you.

Cryptex Technologies

Plot No.8, Gopal Nagar,Nagpur-440022,
Maharashtra, India

Contact No: +91-712-223-2300

Email ID:

Redis is an open source very fast, non-relational, in-memory data structure store. It stores data in the form of a key-value pair. Redis has a support of data structure like sets, hashes, strings, list. Redis is mostly used for the cache store.


When to use Redis?


Redis is used when we have a performance issue related to scalability. For example when we have data in the database which is not going to change frequently then you use Redis to cache that data to remove the load from the MySql or PgSql server.


How to use Redis in Ruby on rails?


In order to use Redis in Ruby on Rails application you have to follow the steps given below:


Step 1:


Add the following gem into the Gemfile of application and run the “bundle install” command.


Improve performance of Rails Application using Redis





Step 2:


Next is to create redis.rb file in config/initializers directory and add the following code into that file 


Ruby on Rails Application using Redis


In the above code “app_name” is the Namespace of my application. Gem “redis-namespace” organize everything under one application wise namespace, when multiple applications use same Redis server.


Step 3:


Next, to instruct rails to use Redis as a cache store we have added following code into application.rb file.


Increase scalability of Ruby on Rails Application using Redis


Step 4:


In the below code I have written a query in booths_controller.rb file to fetch all booths of size 16m2. And write a helper method in booths_helper.rb to fetch the data from Redis.


Ruby on Rails Application using Redis



Ruby on Rails Application using Redis


In the above code when we call the new_booth method of booths_controller, it will call the fetch_booths_16 helper method.


In this fetch_booths_16 method, the booths_16 will get nil value because no data is pushed into redis yet. We then instruct rails to push booths_16 data into redis. Then after a subsequent call to this method, data will be fetched from redis.


Since we are loading data in new_booths as a json we have to change when you call to @booth_size_16[“name”] because data is in the form of json.


Advantages of using Redis:

  • Support for rich data structure types: hash, string, set, list, sorted etc.

  • Data is stored in memory and retrieve quickly: Redis store data in memory so instead of requesting data from the server it will fetch from memory and retrieve data very quickly

  • Redis is used to speed up service response.

  • Redis is a very fast non-relational and NoSQL key-value pair data store.

  • Redis allows to insert a large amount of data into its cache very easily: Sometimes a situation comes like we have to load a thousand pieces of data into cache in a short period of time. This can be done by Redis, with mass insertion feature of it.

  • Redis uses “Redis hashing” which is its own hashing mechanism: Datastore in redis in the form of key-value pair i.e. string field and a string value.


Redis offers efficient caching mechanism and it will take very less time to implement this cache mechanism. But outcomes of using this will get high-performing cache system in our application.


So this is the way you can improve the performance and increase the scalability of Rails application to a great extent.

In this blog, you are going to learn about the deployment of rails application on the production server with its configuration setting in Apache. For this, you need to have Ruby, Rails, MySQL installed in your server system.


Let’s begin with the process of deploying the Rails application.


Step 1: Add the code copy to the server.


          For adding code to the server, you need to take a copy of the code on your server by login using sftp.


$ sftp

$ put samplecode



Step 2: Installation of project and configuration settings.


          Install all libraries of the project and make configuration settings including configuration of database.yml and secrets.yml by using following commands. For this, you need to login to the server using ssh and go to the project folder.


$ ssh

$ cd samplecode


          Rails app has ruby versions and you have to use that specific version to run the application. So, use the ruby version of the application.


$ rvm use (ruby version)


          Install all libraries of the project, set the database and compile assets. Rails have some specific commands to do that.


$ bundle install

$ rake db:create RAILS_ENV=production

$ rake db:migrate RAILS_ENV=production

$ rake assets:precompile RAILS_ENV=production


          Rails provide a secret key which you have to mention it into the config/secret.yml file of the application to maintain the security.


$ rake secret


Above command provide a secret key, add it to the config/secrets.yml file of you RoR project.


Step 3: Apache settings


          You have to do apache settings to run the application in production mode on apache server. For this first, you have to create samplecode.conf file in etc/apache2/sites-available/ path.


The file content will look like as in Image 1. Where you have to mention the domain of your application like and server name like With this, you also have to mention the path of a public folder of the application and ruby version of the application.


Deploying RoR Application on production server


Image 1: Samplecode.conf File


You need to create the symlink of the file samplecode.conf to the sites-enabled folder.  It is created for apache and virtual host settings. This virtual host setting will tell Apache where your application is located. Replace with your application name and as well as mention path to ruby with the ruby version of the application into the samplecode.conf file.


          If you start the application on some port and not on some domain like, you need to specify the port number in the conf file in place of port “80” at the top of the file. And then mention that port to the ports.conf file which is located at /etc/apache/ports.conf.


Deploying Ruby on Rails Application on Production Server


Image 2: Ports.conf File


In the above image, you can see how to mention port, like I have mentioned port 3000 to be heard by apache while serving the page. At last restart the apache server by using the following command. It will run the application on the link like or if it is for a domain then it will run on or


$ sudo restart apache2 restart


In this way, you can start a rails app on the production server.


In my coding lifetime, I have enhanced and improved my coding style after client feedback and guidance. I have learned over the years of time, that there aspects and points that has utmost importance in the coding of Ruby on Rails (RoR) application.

We as developers start writing code without actually analyzing and understanding the code requirement as well. A messed up code is no one’s favorite and not to be delivered.

I am sharing my thumb rules that will surely help you as it did to me.


Rule No. 1: Indent your code

What if you are given a much messed up code to update? I am sure you will get frustrated; in order to write very clear code keep it well indented. In Ruby on rails, though the auto-generated code is four space indented style we should use two spaces to intend our block of code as this is most widely adapted style. This improves the readability of our code.


Rule No. 2: Name it well!

Naming convention should be followed as this is helpful for us to understand the purpose of it and at certain places, active record in ruby also works on the basis of names.

Active record uses the same naming convention in order to find out how the mapping between the models and database tables are created.

Say for example a class “Category”, should have a database table called “Categories”. The rails pluralization mechanism is very powerful such that it is capable of pluralizing both regular and irregular words.

When it comes to naming a variable, you should follow CamelCase form, which says that the first word should start with a small letter and the next word should start with a capital letter, e.g. “categoryOne”.

When the table name has two words, it should be separated by “_” , e.g. “book_categoryies”. When it comes to model class, it should be singular with the first letter of each word capitalization e.g. “CategoryBook”.

Similarly, the name of methods should be such that it should define the purpose of that method, for e.g. “category_list”.


Rule No. 3: Less If else, Less complex

If else statement is a block of condition where you check the condition if it is true or false.

Using the number of if-else statement creates makes the code bulky. It will increase the number of lines in the code, which can be reduced or should not be used at all. It also makes the code complex and not easy to understand.


Rule No. 4: Use of a number of variables

What do variables do in rails? It allocates the memory for which it is assigned for. When the expression can be directly assigned or can be directly passed, a variable should not be used as this will be the unnecessary allocation of memory, unnecessary declaration of a variable.

In Ruby on rails development, we have four different types of variables global variables, class variables, instance variable and local variables.

Global variables are accessible globally in the application which means it can be modified from any part of the program hence it let to lack of security of our code.

Hence it is recommended not to use global variables.

Always try to replace instance variable with local variable as local variables are accessed locally which ensures the security of our code.


Rule No. 5: Put-up a comment there

Comments are the description written in the source code within the special character so that it should be ignored by the compiler.

What if, you get a new project with some classes having methods in it? Will you be able to understand the purpose of it?

Even, if the method name is good enough? No, sometimes only method names do not help in recognizing or understanding the main purpose of the method or how it works, hence your method should be well commented in order to let others also understand its basic purpose.


Rule No. 6: Don’t put too much logic in the view, make use of helpers, create them!

Views are specially meant for displaying the data hence it should not have too much logic, this can be done by making use of helpers, if the piece of code is used many times in a view, make a helper and call it in a view.

So, these are my six thumb rules while writing code, from the time that I have become the developer. These have helped me and can be taken as consideration to make your code scalable, robust and secure.

This will add sparkle to your code, which will eventually make your client happy! :)  

If you have a different lookout, let me know your views, in the comments section below.

Automated testing is extremely on the boom, across the board nowadays and obviously Ruby has its own arrangements to make it work for Ruby on Rails developers. One of these is RSpec, a madly prevalent tool for mechanized testing. The fortunate thing about it is we can test almost every part of RoR Application easily.


Rspec is easy to get it up and running, expressive way to write test cases, easy to use and also fast.


Let’s start with assembling all the components together to start with:


To begin it’s necessary to install Ruby. You can do it from here for Windows OS:


After completing installation let’s check if Ruby is installed properly along with version number.


  • For this go to command prompt and type:

                 ruby -v


        You will get the following result.


Automated Testing using RSpec and Selenium


  • Next, you need to install RSpec gem. Gem is Ruby library which can be used in one’s own code.
  • Go to command prompt and type the following :
       gem install rspec


       You will get the following output:


    Done installing documentation for diff-lcs, rspec-support, rspec-mocks,

rspec-expectations, rspec-core, rspec after 22 seconds 

6 gems installed


  • To start with Selenium in Ruby you also need to install the gem selenium-webdriver which will act as a binder for Ruby from the command line.


Type the following command to install ‘selenium-webdriver’:


gem install selenium-webdriver
  • Now, create directory i.e. folder to store Rspec scripts. Open your command prompt and change the directory path to the one where you would be saving your scripts.

Example: If your directory name is ‘sample_scripts’ on desktop:




Let’s start with writing script in Rspec.


So for this open any editor. Here, I have used sublime.


  • Write the following code in the sublime editor and save it. Save it with name sample.rb


Automated Testing Codes of RSpec & Selenium



  • To run the script go to command prompt and type:
C:\Desktop\sample_scripts>rspec sample.rb

 You will get the output as following after executing the script:


 Finished in 0.002 seconds (files took 0.11101 seconds to load)   1 example, 0 failures


Keywords in Rspec:


As this is targeted to new coders, you need to know some keywords which are meant to be used in your code. This helps in understanding the protocol to be followed while coding.


  • describe..... do

Description of the collection of related test cases



Individual test cases


  • Before() and After()


Optional test statements run before and after each or all test cases.



So, let’s hope you have understood the significance of using RSpec while automation testing.


This reduces your time to test & increases the efficiency of testing.


The code quality is needless to mention becomes high.


All these steps are for test-driven development (TDD) environment if you want to know how to use RSpec in Behaviour Driven Development (BDD) please refer our previous blog about it.


Aren’t we testers meant to have this as our focus? This is all about the beginning of using RSpec in your Ruby on Rails Development process.





When working in a team, you may have come across a situation wherein there are many copies of Code of your Ruby on Rails Application and then you really don't know if it has been updated,well-organized or well merged, for that matter, haven’t you?

Well, GitHub is your solution to the same.GitHub is that platform that I rely a lot on my coding. Be it organizing, updated code or merging code, this platform takes care of it all.

GitHub is a code hosting platform for version control and collaboration. It is a very useful tool that allows you to work in any geographical location.

GitHub is the most powerful platform for management and review of the code. Github is used for managing the code on the single platform. Using GitHub you can track the changes of each commit. Github also provides public and private repositories. The public repository is most commonly used for open source software applications.

Let’s learn:

  • How to create a repository in a GitHub?
  • How to create new branches and manage these branches in  GitHub?
  • How to push your code in GitHub?
  • How to manage commits?
  • How to create and manage pull request GitHub?.

I’ll start considering you a RoR developer and then, of course, you know how to create your account in GitHub. Well, You should know that!

        On Logging into GitHub, you’ll find many options and parameters but for a kick-start to committing codes in GitHub, first, you need to create a repository.


     Create a repository in a GitHub :

The GitHub repository is a  virtual directory or space where we can access your project, its files, and all related data.

GitHub - Platform for Software Development

On click of new repository button, you will be redirected to new directory form page. You need to follow the below steps to create a new repository in GitHub.

  1. Write a valid name for the repository
  2. Write a short and simple description of the project.
  3. Click on new repository button to submit the form for creating the repository.

GitHub - A Platform for Software Developers



After successful submission of the form, you will be redirected to the Setup page of the created repository.

Software Development and Code Committing Platforms - GitHub


First of all, take a clone for the projects, you need to make your backup is ready!. Use the following command.


git clone


Then you need to change the directory


cd sample-app


If you want to create a new branch by command line and switch to that branch you can use the below command.


git checkout -b  NC-2018-06-charts-data


Your  branch name should be short and descriptive


You can also change the current working branch by using the below command.

git checkout  NC-2018-06-charts-data


Push the code:


Now, once whatever changes you have made in the file you can track by using the below command.


git status


The above commands will list out all of the changes in files.


You can also check what contents and lines have been modified by using the below command. It will list out the changes, the Green color will show the line added and the red color will show line removed


git diff “file_path”


If the files are ready to push you can add these files by using the below command.

git add “file_path”


You can also remove the file from your local system and the remote system.

First, you need to delete the files locally then after executing the command “git status” it will list out the files that have been removed locally, then you need to run.

git remove “file_path”


After adding all the files you can commit the code on the remote server.

git commit -m “The commit message”


After adding all the files you can push the code on a remote server by using the command.

git push origin Rs-2018-06-charts-data

Manage commits:


IF you have NOT pushed your changes to the remote repository and just committed the code and then you may want to remove the commit, use.

git reset HEAD~1


If you have pushed your changes and you may want to revert to the previous commit then you need to run the below command.

git revert HEAD


This command will revert/remove the last one commit/ change.


Create and manage pull request:


Software Development and Code Committing by Team


First, you will have to take the fork of the repository then you can change in the code and commit the code.


On click, or pull request, you can send the pull request to the specified person. After getting the pull request you can click on Merge pull request. Your commits will be merged into the base branch.


So, now you know, how easily GitHub can manage the code -not depending on any locations!!

Export data in HTML table is one of the most convenient features in the web application.  


Basically export means the user can download the data in some format like Excel, PDF or CSV. Once the data get exported it can be used offline.


Nowadays most of the web applications process data easily without accessing the server continuously at client side itself. It becomes more user-friendly in rapidly accessing data without interacting with the server. It gets required data once on the client side and process as you want.


When to use data exporting in Web application:


Web application developed for administrative purpose where a large amount of data get added on daily basis.


If you want to analyze data offline, exported data help you to create reports for future scope, what will be the next strategies to improve your business.


Data in the tabular format most of the time is required to export.


Let’s take an example of buyers/user in an inventory management system, which contains buyer details.


Sr. No



Mobile No




8806 Green Hill St.


Roney is a student


John Tale

7 Sherman Lane


Professional Writer



Massapequa Park


Sales Executive



9872 Wagon Station





Bayberry St. Lilburn




Table 1: Buyer/User Details


Export HTML table data in excel using jQuery is one of the best approaches to implement, no need to use any jQuery plugins. On click of a button, the user can easily download the data in excel format.

This document will help you to export table data in excel file format with column heading present in the table.

Below is the example of Rails view table code with “Export to Excel” button.


Export HTML Table Data into Excel in ROR Application


Figure 1: Code for Export HTML Data into Excel


Tags used in rails view table:

<caption></caption> tag is used to get the heading in excel sheet after export.


Hidden column data export in excel:

In the above table code if you add any hidden column names, still you can export data in excel.

For example, I have the comment column, I don’t want to display in the table of rails view but comments should be exported to excel.

In that case, just add hidden <th></th> tag in header and body ( to hide <th> you can use display:none css ) of table, where you want in a sequence.

<th class="text-center hidden-th">Comment</th>

After clicking on “Export To Excel” button hidden column data will export.

Javascript function to export data:



      function exportDataToExcel(table-id, filename = '')

          var downloadurl;

          var fileType = 'application/';

          var tableSelect = document.getElementById(table-id);

          var dataHTML = tableSelect.outerHTML.replace(/ /g, '%20');

          filename = filename?filename+'.xls':'user_details.xls';

          downloadurl = document.createElement("a");



              var blob = new Blob(['\ufeff', dataHTML],

                  type:  fileType


             navigator.msSaveOrOpenBlob( blob, filename);


           downloadurl.href = 'data:' + fileType + ', ' + dataHTML;

  = filename;






Above exportDataToExcel jQuery function will take the table id to get the data from the table of rails view.


After that, it will generate the downloadable URL.


In below line of code, you can provide the file name


filename = filename?filename+'.xls':'user_details.xls';

See the exported HTML user data in excel format in the given Table 2:

Export HTML Table Data into Excel in ROR Application

Table 2: Exported HTML User Details in Excel Format

 Above is a simple way to export data easily in excelling format. Likewise, you can export data in CSV and PDF format just mention the file type in for example:

csvFile = new Blob([csv], {type: "text/csv"});

We can also customize the excel view and content as per requirement. Above is the simple and easiest way to implement data export in excelling format.

Hope, this blog helps you in your Ruby on Rails Application!

Please post comments below, if I could be of any help.


QR Code: Why they are more helpful than a standard standardized identification? Is that they can store more information, including URL connections, content and so on.


Here, I am automating - I mean to say scanning/reading QR code without any mobile or without any scanner.


To make this work, please follow the steps given below:


Step 1:


Locate the existing QR code path in your local storage location.


In below screenshot, I have shown the location of QR code from my local storage location.


This location/path is used to convert into a URL and put into the selenium script.


Below QR_Code is in image format which is in .png format.



Software Testing in Ruby on Rails Application


Figure 1: QR Code in Image Format


Step 2:


This image should be converted into a URL path. It is too simple. Please follow the instruction given below.

  1. Open Google Chrome.
  2. Pick your QR_Code image and drop into google chrome.
  3. Now, the image is converted into the URL. (Please check below image)
  4. Copy URL and put into selenium script.


QR Code Automation - Software Testing in Ruby on Rails Development


Figure 2: QR Image converted into URL


Step 3:


Now, open eclipse


Create Java project


Import required library as follows,


1. Selenium-server-standalone

2. Testng

3. Zxing

4. Zxing-1.7-javase

(Please refer the image given below)



Ruby on Rails Development and Software Testing


Step 4:


Write a script in Eclipse editor.


Import org.openqa.selenium.webdriver;

import org.testng.annotation.Test;

  public class QRAutomation {


        public void testQRCode()


System.setProperty("", "chromedriver.exe path");

WebDriver driver = new chromeDriver();


driver.get(" C:\\Users\\Prateek\\Desktop\\QR_Code_Updated.png");

String qrCodeFileUrl =         driver.findElement(By.tagName("img")).getAttribute("src");

System.out.println("QR Code Image URL is : " +qrCodeFileUrl);

URL urlOfImage = new URL(qrCodeFileUrl);

BufferedImage bufferedImage =;

LuminanceSource luminanceSource = new           BufferedImageLuminanceSource(bufferedImage);

BinaryBitmap binaryBitmap = new BinaryBitmap(new          HybridBinarizer(LuminanceSource));

Result result = new MultiFormatReader().decode(binaryBitmap);

String textInQrCode = result.getText();

System.out.println("The Text in QR Code is : "+textInQrCode);



Step 5:


Understanding the code

  1. Bufferedimage: It is used to handle and manipulate the image data.


  1. To perform the image read-write operation we will import the ImageIO class.


  1. LuminanceSource: The examples are extracted from open source    Java projects.


  1. BufferedImageLuminanceSource: Always use the returned object, and ignore the length of the array.


  1. BinayBitmap: This class is the core bitmap class used by ZXing to represent 1-bit data. Reader objects accept a BinaryBitmap and attempt to decode it.


  1. HybridBinarizer: It is designed for high scale images of QR code with black data on white backgrounds. This Binarizer is the default for the unit tests and the recommended class for library users.


  1.  MultiFormatReader(): By default, it attempts to decode all QR Code formats that the library supports. Optionally, you can provide a hints object to request different behavior, for example only decoding QR codes.

Step 6:


Run the script in Eclipse.


Click on “Run” button





Step 7:


Display the result in a console of the eclipse


After clicking on the Run button, the result/output is displaying on the console of the eclipse. (Please refer the image given below.)



Ruby on Rails Web Application Development with Automated TestingAbove image is used to display the output in console panel.



QR Code Automation Output - Software Testing in ROR Application


Above image display, the actual data stored into the QR code and as same output are printed in eclipse console.


  • Advantages of QR_Code testing:


  1. This is used to test that the actual data matches with expected data.


  1. Security and Authorization is the base of all applications. Hope, the above way of automated testing helps you to test security and confidentiality of data in a better way.
What is Rspec?


Before implementing Rspec you should know what is the actual meaning of Rspec? R stands for ‘Ruby’ and the meaning of ‘Spec’ is Specification. RSpec is a unit test framework used in Ruby on Rails web application development. RSpec is 'Domain Specific Language' (DSL) testing tool. You should write Rspec in Ruby language to test your Ruby code.


Why do you use Rspec?


Rspec is an automated test case, used to test the code written by you while creating the application.

Developers follow the Rspec to write is known as TDD (Test Driven Development) and the Rspec written by the Testers, generally known as BDD (Behavior-driven development).


Advantages of Rspec:


There are several advantages of Rspec when you use it in your application.


  • Rspec always performs fast tests.
  • Rspec is very good for unit testing, that is testing models, controllers, and views.
  • If you develop the test cases with Rspec is easy and clear to Understand.
  • Much clear failure reports.
  • RSpec includes traditional Unit Testing, which means testing a class or part of the application in isolation from the rest of the application.
  • RSpec used for Acceptance Testing known as TDD (Test Driven Development) or BDD (Behaviour Driven Development) Specification.  These are support business-case driven Integration Tests.


How to setup Rspec in your Rails app?


Now to configure Rspec or to setup rspec in your application you should go through the following steps.


First you need to add rspec-rails to both the :development and :test groups in the Gemfile:

1.  group :development, :test do

          gem 'rspec-rails', '~> 3.7'




2.  Then you should run the command,

    bundle install



3.  Then you should initialize the spec/ directory with:

     rails generate rspec:install


This adds the following files which are used for configuration:





If you want to add the files for your controller or model, then first you need to create the controller or model directory under spec folder and add the specific files inside those folders.

As an example you can say, spec/controllers/category_controller_spec.rb.


4. To run your specs you need to use the ‘rspec’ command.
     i.e ~$ rspec


What is the basic syntax of Rspec?


1) describe:


Here describe is the Rspec Keyword, which is generally used to define a class name or an example group or string arguments. This is the basic building blocks to organize the tests.


  RSpec.describe HelloWorld, type: :class do

    describe HelloWorld do

     context "when testing the helloworld123 class" do

      it "should say 'Hello World' when calling the method" do


       msg= hlo.say_hello

       expect(msg).to eq "Hello World!"

       puts "HelloWorld executed!"






2) context:


The context keyword is the same as describe keyword.  It also accepts the string arguments or class name.


Here context is a block which is used to describe the context, in which the class or method mentioned in the describe block is being used.



context "With valid input" do


3) it:


it keyword basically defines what is the example do. In simple word, you can say, what kind of test is performed that is defined by it keyword. It also used in a block of a statement and it contains do/end.



it 'create a new blog with a blog_name and description'


4) expect:


It defines what the expected output for the test is. It’s nothing but the expectations in rspec.


Sometimes need to use expect().to be true. It depicts the test result is expected to be true i.e positive test cases. Similarly  expect().to be false, it is expected the negative test results. RSpec uses a simple framework and keywords like should() and should _not() to express expectations.

Expect also use eql keyword i.e expect().to eq “hello”. Eql is basically a matcher that used to show the equality of test result with the expected result.



expect(response).to be_success


RSpec in Test Driven Development


RSpec in Behavior Driven Development


At last, I hope this article will be helpful to understand and implement Rspec in your ruby code and to cover all the scenarios (i.e including positive and negative test cases).


All the Ruby on Rails Developers, you can save a lot of your time while testing Ruby on Rails code making it faster. And overall it will be very much useful to write the automated test cases rather than using the manual test cases.

  Everything is shifting from a physical, tangible experience to a more personalized, yet virtual interface. The dating game has changed with Tinder and you can even experience landing on the moon from Apollo 15 by just putting on those VR goggles. The dynamics of life have changed and with that has changed your lifestyle.


  Have you ever visited an exhibition? The hallways are swarming with people, everyone wants to go around in that stipulated time. Other than the high ticket fares, you can only visit the one exhibition on display for the weekend in your city, not those in Paris or Sydney.


 Cryptex has developed virtual exhibition software, an exhibition on the tiny screen you can carry around the entire day. Unlike the conventional, physical expos, this application allows you to access any exhibition from over the world, which is on display in the application. While the end user can choose the category of expo they wish to visit, the businessmen and companies can get a filtered audience, instead of a large footfall not converting into business.


  We at Cryptex have made sure that the virtual touch doesn’t sideline the human needs. With an inbuilt chat system using both audio and video functionality, the user can communicate with the exhibitor freely. Apart from reading the business brochures stacked on the book stand by the booth, the visitor can add it to his briefcase for referencing later.


Virtual Trade Fair


   Figure 1: Virtual Fair


Owners can present an online presentation of their work, products or simply an informative tour of the business. For future communication, they can provide their social media handle links along with the website link or Email ID on a virtual booth.


Virtual Exhibition Software

Figure 2: Virtual Stalls

  A feature of exchanging visiting cards is also provided on this booth. This can be treated as a trade show management software. 

The next step is to include a VR feature enabling the users to have a wholesome experience, touring in any exhibition they wish to.


Devise is a flexible authentication solution for Rails. It is a complete MVC solution based on Rails engines. It allows you to have multiple models signed in at the same time. It hashes and stores a password in the database to validate the authenticity of a user while signing in. The authentication can be done both through POST requests or HTTP Basic Authentication.

This ultimate feature of Ruby on Rails development makes your application more secure than other platforms.

STEP 1: gem 'devise' install


STEP 2: run bundle install


STEP 3: run rails generate devise:install


rails generate deviserun STEP 4: :views


Let’s see an example of STEP 5: application in which need 2 models assuming one is member model and the other is contact model. So now we are going to create our member model using devise:

run rails generate devise member

The migration file will be located in

db/migrate/ devise_create_members.rb.


Ruby On Rails Development Using Devise


rake that, you should have to runAfter STEP 6: db:create (For creating new database)


rake runSTEP 7: db:migrate

Once you run the db:migrate command, rails will create a table called members with the following field that the Devise specified in the migration file. Check the tables have created successfully.

STEP 8: run the server by typing “rails server” and copy and paste the 1 and 2 addresses to your browser search bar.




STEP 9: run rails generate migration add_username_to_members username:string

We have to add the username to the sign-up form. This command will generate another migration file in your “db/migrate” directory.


Ruby On Rails Application Using Devise

rake runSTEP 10: db:migrate


STEP 11: run rails generate model contact


Edit the migration file of contact and specify the 2 fields as shown below.


Open db/migrate/ 20180312073055_create_contacts.rb.


Ruby On Rails Development Using Devise

STEP 12: run rake db:migrate

STEP 13: run rails generate controller home


And then create a new index file for the home controller like “app/views/home/index.html.erb and then add the following.



STEP 14: Once you have done, open app/config/routes.rb

add this line


root :to =>'home#index'


STEP 15: run rails generate controller registration

Open “app/controllers/registration_controller.rb” and then edit the file as shown below.



STEP 16: We have to mention the relationships between 2 models (member, contact). Here the relationship will be as follows.

Open_Filepath: app/models/member.rb



Open_Filepath: app/models/contact.rb



STEP 17: Now refer the registration controller file in app/controllers/registration, here after completing the registration & the values that the member entered is stored in the table successfully I just redirected the member to the dashboard page. So we have to add that page to our home controller.


Open_Filepath: app/views/home/dashboard.html.erb


Open app/config/routes.STEP 18: rb and you have to specify this path in our routes.rb file.


STEP 19: run “rails s” and go to http://localhost:3000 address to your browser search bar.



       There are a number of gems used in Ruby on Rails Framework. Cocoon gem is one of them; this gem is basically used for Nested forms, multiple models and in multiple attributes in one form.


Nested forms in Rails are the forms which are used for creating; updating, deleting multiple models data using a single form.


For example, we have two models user and address. If we have to save user and address data from single form here nested forms are used.


Let us consider another scenario, if we have to save one user data having multiple addresses at that time cocoon gem is very useful.


The cocoon gem generates nested form and adds/remove button for adding/removing multiple forms for the nested model (in above case “addresses”).


Simply clicking on add/remove button we can generate multiple form fields of the nested model (addresses).




This gem requires jQuery. If jQuery is not present in the project then simply add “jquery_rails” gem to gemfile.rb.




Add following in Gemfile.rb file:

gem 'cocoon'


Also, add following in the application.js file:

//= require cocoon


That’s all about the installation process.


Let’s see an Example PROJECT


For creating a Project model, controller and views using scaffold command just run:

rails g scaffold Project name:string description:string


Then create a Task model which belongs to the project:

rails g model Task description:string done:boolean project:belongs_to


Changes in rb file:

class Project < ApplicationRecord

  has_many :tasks, inverse_of: :project

  accepts_nested_attributes_for :tasks, reject_if: :all_blank, allow_destroy: true



No changes required in rb file:


class Task < ApplicationRecord

  belongs_to :project




Changes in projects_controller.rb file: 


def project_params

  params.require(:project).permit(:name, :description, tasks_attributes: [:id, 

  :description, :done, :_destroy])



Changes in projects/_form.html.erb file:


Cocoon Gem in Ruby on Rails Development



Create a new file named as _task_fields.html.erb in the projects folder in view and add following code in it:



Cocoon Gem in Ruby on Rails Development



Following are the snapshots of output scenarios:


  1. Creating a new project:


 Creating a new project in Ruby on Rails

  1. Adding one task in project form (click on add task link to render task form):


Nested Forms in Ruby on Rails Development


  1. Adding two tasks in project form:


Nested Forms with Add or Remove Tasks in Ruby on Rails Development


Similarly, we can remove task form from the project by clicking in remove task link present on the project form.


In the process of web application development nested forms play important roles that can be achieved by using COCOON GEM so that one can add multiple instances of nested form in a form.

As a web developer, everyone knows the importance of HTML & CSS for making his or her web pages to be interesting.

We all know that web languages upgrade regularly, so all web developers need to stay current and updated. The latest version of HTML has introduced in the market i.e. HTML5.

HTML5 has all new features that you will love to use while making document structure.

A bunch of new tags to make our pages more semantic has introduced in this version. It will also help search engines and targeted audience to navigate our pages and improve the web experience for everyone. Some of the new semantics or structural elements have been covered here:

Tags Description


  Defines an article in a document


  Defines content aside from the page content


  Defines self-contained content


  Defines marked/highlighted text


  Represents the progress of a task


  Defines a section in a document


  Defines a ruby annotation


  This tag contains navigational elements, such as the main navigation on a site or more specialized navigation like next or previous-links.

Some of the tags are explained with examples below:

1) Article Tag

  <p class="content font-new"> Content </p>
  <p class="content font-new"> Content </p>

2) Aside Tag

<aside class="menu-sidebar d-none d-lg-block">
  <div class="logo">
    <a href="#">
      <img src="/assets/logo.jpg" alt="Jcu" class="logo-img"/>
  <div class="menu-sidebar__content js-scrollbar1">
    <nav class="navbar-sidebar">
        <ul class="list-unstyled navbar__list text-center">
            <li class="active has-sub">
                <a class="js-arrow" href="#">
                  <i class="fas fa-tachometer-alt"></i>APPS

3) Figure Tag

  <img class="thumb" src="images/img.png" alt="" title="product1">
  <figcaption>Fresh Whole Chicken</figcaption>

4) Mark Tag

<p>Peter's Poultry was founded in 1997 and was known as <mark>Prestige Poultry</mark>.</p>

5) Progress Tag

<progress value="10" max="40"></progress>

6) Section tag

<section id="footer">
    <div class="container">
    <div class="row">
      <h4 class="text-center font-size19">CONTACT US</h4>
      <div class="clearfix-20"></div>
    <div class="row">
      <div class="col-md-8 col-md-offset-2">
        <div class="col-lg-3 text-center border-right"><a href="contact.html" class="footer-menu">CONTACT US</a></div>
        <div class="col-lg-3 text-center border-right"><a href="#" class="footer-menu">SITEMAP</a></div>
        <div class="col-lg-3 text-center border-right"><a href="#" class="footer-menu">PRIVACY & TERMS</a></div>
        <div class="col-lg-3 text-center"><a href="#" class="footer-menu">ACCESSIBILITY</a></div>
    <div class="clearfix-20"></div>
    <div class="row">
      <div class="social-media col-lg-12 text-center">
        <ul class="list-inline col-lg-12">
          <li><a href="" title=""><i class="fa fa-facebook font-size19"></i></a></li>
          <li><a href="" title=""><i class="fa fa-twitter font-size19"></i></a></li>
          <li><a href="" title=""><i class="fa fa-instagram font-size19"></i></a></li>
          <li><a href="" title=""><i class="fa fa-google-plus font-size19"></i></a></li>

7) Nav Tag 

<nav class="navbar navbar-inverse ">
  <div class="container-fluid head-border-bottom">
    <div class="navbar-header col-sm-4">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>                        
      <a class="navbar-brand logo-box" href="#">
        <div class="col-sm-12">
            <img src="images/logo.png" class="logo-img">
    <div class="collapse navbar-collapse" id="myNavbar">
      <ul class="nav navbar-nav navbar-right">
        <li class="hvr-sweep-to-top"><a href="index.html">Home</a></li>
        <li class="hvr-sweep-to-top  active-menu"><a href="index.html#products">Our Products</a></li>
        <li class="hvr-sweep-to-top"><a href="food_safety.html">Quality and Food Safety</a></li>
        <li class="hvr-sweep-to-top"><a href="#">Gallery</a></li>
        <li class="hvr-sweep-to-top"><a href="our_story.html">Our Story</a></li>
        <li class="hvr-sweep-to-top "><a href="contact.html">Contact Us</a></li>

Some new form elements are added like ‘<datalist>’ which specifies a list of pre-defined options for input controls and ‘<output>’ which defines the result of a calculation.

Also, new input types with their input attributes, new attribute syntaxes with graphics and media elements have been offered in HTML5.

Not only HTML5 but CSS3 both has given wings to web application development.

CSS 3 has built using the principles about styles, selectors and the cascade that was also in the earlier version of CSS. However, in CSS3 some of the new features have been added like new selectors, pseudo-classes and a lot of properties. It helps in making your layout easily.

A simple introduction for markup is given here. Consider a section with a heading and a paragraph of text. We can make it more appealing using CSS3 features.


#intro {

          margin-top: 66px;

          padding: 44px;

          background: #467612 url ("bg.png") repeat-x;

          background-size: 100%;

          border-radius: 22px;


Here are two new properties which we can use.

The first one is background-size; it allows us to scale the background image.  If we scale it to 100% on both axes the box expands when more content is added to it parallel gradient background will scale as well. This was not possible in CSS 2.1 without non-semantic markup and miscellaneous browser issues.

The second new property is border-radius, it gives rounded corners to the element. Different values can be given to the radius.

Web Development and Designing with HTML 5 tags

It is possible to develop any web app from legal document software to music distribution software with these features of HTML 5 and CSS 3.


Introduction to Vscode (Visual Studio Code)

Visual Studio Code i.e. Vscode is modern and robust code editor developed by Microsoft.

We can use it for setting up Ruby on Rails development environment.

It combines the simplicity of code editor with powerful tools like IntelliSense, code completion, debugging and built-in Git support. One of the beauties of Vscode it's free and open source.

It is available for Windows, Mac, and Linux with huge community support. 

How to Install Vscode?

Installation steps of Vscode are pretty simple, go to Visual Studio it will automatically detect the operating system you are using and provides a download link. After installation, you are ready to start customizing Vscode for Rails development.

How do you set up Vscode for Rails?

· Ruby extension:

The first thing you have to do is install a ruby extension in Vscode. Press f1, type ext install then search for ruby OR go to ‘View’ > ‘Extensions’ and search for ruby and hit install.

· Debugger:

    In ruby extension, there is ruby-debug ide protocol to allow Vscode to communicate with ruby-debug. It requires ruby-debug-ide to be installed on your system. This is how Ruby Mine/Net Beans does by default. Read the documentation GitHub to install ruby-debug-ide protocol.

· Linters:

Linting is the process of running a program that will analyze code for potential errors. Below is the list of linters supported by ruby. You will need to install the ruby gems for each of these for Linting to work:

1. rubocop

2. ruby-lint

3. reek

4. fasterer

5. debride

After installing ruby gems for linters, enable each one in your workspace or user settings. To do this go to ‘File’ > ‘Preferences’ > ‘Settings’ and paste the below settings.

 "ruby.lint": {

      "reek": true,

      "rubocop": true,

      "ruby": true,

      "fasterer": true,

      "debride": true,

      "ruby-lint": true


· Ruby on Rails snippets extension:

Ruby on Rails snippets extension save your lots of time. After installation reloads Vscode and just type ‘controller-rest’ it automatically writes all the rest methods for you. It will save your 80% time. There are many snippets available for controllers, models, and views. Go ahead try yourself.

· Ruby Solargraph:

Solargraph is a language server that provides IntelliSense, code completion, and inline documentation for Ruby.

Themes and Editor Settings

· Theme:

Vscode provides a couple of built-in themes. If you are the sublime user, just go to ‘File’ > ‘Preferences’ > ‘Color Theme’ and select ‘Monokai’ theme. There are hundreds of themes available for you, just go to ‘File’ > ‘Extensions’ and type theme name and install it.

· Font:

The font is one of the most important things when you are writing code. If the font of your code editor doesn’t look good you cannot write code for a long time and it hurts your eyes.

'. Download it and install on your system. Go to FIRA CODE. There is beautiful font available for you that is ‘Vscode settings and add below settings to activate ‘FIRA CODE’.

"editor.fontFamily": "Fira Code",

"editor.fontLigatures": true,

 · Editor settings:

These are some editor settings that you can prefer.

"editor.lineHeight": 40,

"editor.rulers": [80,120],

"[html]": {

                 "editor.foldingStrategy": "indentation"


"html.format.indentInnerHtml": true,

"editor.tabSize": 2,

"editor.formatOnSave": true,

"editor.autoIndent": true,

"editor.fontWeight": "500",

"html.suggest.html5": true,

"editor.fontSize": 17,

"editor.minimap.maxColumn": 30,
Task Automation:

Lots of tools available to automate tasks like Linting, code formatting, and testing. These tools uses command line interface to run the tasks. But we want everything in our editor, we don’t want to switch from editor to terminal for running single command.

To create tasks in Vscode click on ‘Task’ > ‘Configure Task’ > ‘Create task.json file form template’ > ‘Others’ it will create ‘.vscode’ directory into root of your project and also creates ‘task.json’ file. Below file generated by Vscode.


// See

// for the documentation about the tasks.json format

"version": "2.0.0", "tasks":



       "label": "echo",

       "type": "shell",

       "command": "echo Hello"




 The task array contains all your tasks. Read more about task automation in Vscode. It makes developer life easier.

We have created a couple of tasks for HTML beautifier, Rubocop, rspec, rails server etc. You need to install HTML beautifier gem to use ‘beautify’ task.

 "version": "2.0.0", "tasks":



     "taskName": "beautify",

     "type": "shell",

     "command": "htmlbeautifier ${relativeFile}",

     "problemMatcher": [],

     "presentation": { "reveal": "never" }



    "taskName": "rubocop",

    "type": "shell",

    "command": "rubocop --auto-correct ${relativeFile}",

    "problemMatcher": [],

    "presentation": {"reveal": "never"}



   "taskName": "rspec",

   "type": "shell",

   "command": "bundle exec rspec",

   "problemMatcher": [],

   "presentation": { "reveal": "always" }



  "taskName": "rspec file",

  "type": "shell",

  "command": "bundle exec rspec ${relativeFile}",

  "problemMatcher": [],

  "presentation": {"reveal": "always"}



 "taskName": "rails c",

 "type": "shell",

 "command": "bundle exec rails console",

 "problemMatcher": [],

 "presentation": { "reveal": "always"}



  "taskName": "rails s",

  "type": "shell",

  "command": "bundle exec rails server",

  "problemMatcher": [],

  "presentation": { "reveal": "always"}


 So here it is folks, you can create many tasks as per your requirement. If you need any help for setting up Vscode for Ruby on Rails development please comment below :)

Being a Rails developer we are familiar with ActiveRecord queries, but not so much with Arel. Arel is a library which allows us to customize our queries in object-oriented manner without having to use manual SQL and string interpolation.

We often use where a method for querying the database. Where method can handle equality, null, arran ays and now in Rails 4 it is also able to handle inequality condition with not method. But when there is a requirement of writing queries with OR statement or greater-than or less-than conditions most developers opt for writing SQL string queries. We have a better way to handle this situation using Arel.

For example:

If you want to select students having the date of birth greater than today’s date or date of birth less-than or equals to today’s date, usually a developer will write the query like this

Student.where("date_of_birth> ?",


Student.where("date_of_birth<= ?",

But this is not a good way to write such queries as we can write these queries in a more better way using Arel like this




In the same way, ActiveRecord does not provide support for OR queries in earlier rails version.

If you want to fetch all the students having first as John or last name as Doe you can write the query like this but that is not the recommended way

Student.where(“first_name = ? OR last_name = ?”, “John”, “Doe”)

The recommended way of writing a query for the above scenario is

arel = Student.arel_table


Same with the LIKE queries when we opt for writing SQL string literals

Arel has a keyword called matches for writing LIKE queries

Advantages of Using Arel are:

1. Follows DRY principle

Most of the time we write duplicate queries having one different parameter. We can avoid writing such queries using Arel. Because we can write queries in methods and that methods can be used for another query as well as we can design query builder using Arel.

2. Reliability

When we write Join query using SQL string it can break down due to ambiguity in column names but this is not the case with Arel.

3. Readability

Methods provided by Arel are readable to anyone who even don’t know much about coding. As we can write queries in parts using Arel it is much easier to understand in parts.

Arel allows rails developer to write queries in an object-oriented manner and it also allows us to write more complex queries with ease and modular code. Next time, when you stuck into complex queries go for Arel. This article just provides an overview of Arel as there is much more to explain in Arel. Detail description is available in the official docs of Arel.

Many times, we need to track the page views of any page such as profile page, shopping sites page in a Ruby on Rails applications, for which we can make use of Impressionist gem to track those page details easily.

It is a lightweight plugin that logs impressions per action or manually per model. We can log impressions multiple times per request. And we can also attach it to a model.

Below are the simple steps needed to follow to implement it:

Step 1: Create a sample app using scaffold.

Step 2: Add “gem ‘impressionist’” gem to the Gemfile and install it by running bundle install command.

  • gem ‘impressionist’, git: ‘’

Step 3: Now generate the impressions table migration by running the below commands:

  • rails g impressionist
  • rake db:migrate

Step 4: Now we need to update our controller that we want to add the impression or page views counting system. So first we have add the following method in our controller with mentioning the list of actions that we want to count:

And then update the controller action with the impressionist method:

Step 5: We need to add the new counter cache column to the model that we are working with. Run the following command:

  • rails g migration add_impressions_count_to_blogs impressions_count:integer
  • rails db:migrate

Now we can update the model for tracking the hits:

Step 6: Now we can display how many views this Blog has.

The dynamics of web development have changed over the years. The HTML single page coding with CSS styling is an obsolete method now. One of the open source front end web application framework is the JavaScript based AngularJS, which has been in the industry for around 6 years now.

  • What reason do we need Protractor Framework for?

Protractor is a node.js program that is used to write end-to-end test. The tests are written in javascript to simulate user stories on a web browser. Protractor is effectively built upon webdriver so a lot of stuff we do on protractor will seem very similar.

JavaScript is utilized as a part of all web applications. As the applications develop, JavaScript additionally increments in size and many-sided quality. In such case, it turns into a troublesome situation for Testers to test the web application for different situations.

In some cases, it is hard to catch the web components in AngularJS applications utilizing JUnit or Selenium WebDriver.
Protractor is a NodeJS program which is composed in JavaScript and keeps running with Node to recognize the web components in AngularJS applications, and it additionally utilizes WebDriver to control the program with client activities.

  • What reason wouldn’t bediscovered in Angular JS web components utilizing Normal Selenium Web driver?

Precise JS applications have some additional HTML properties like ng-repeater, ng-controller, ng-display and so on, which are excluded in Selenium locators. Selenium can’t recognize those web components utilizing Selenium code. Along these lines, Protractor on the highest point of Selenium can deal with and controls those qualities in Web Applications.

The protractor is a conclusion to end testing system for Angular JS based applications. While most structures center on leading unit tests for Angular JS applications, Protractor centers on testing the genuine usefulness of an application.

  • Before we start Protractor, we need to install the following:


NPM (Node.js)

Protractor Installation

  1. Open command prompt and type “npm install –g protractor” and hit Enter.
  2. Check the installation and version using “Protractor –version.” If successful it will show the version as like in below screenshot. If not, perform the step 1 again.
  3. Update the Web driver.
    webdriver-manager update

    webdriver-manager start

    Now, if you go to the following URL (http://localhost:4444/wd/hub/static/resource/hub.html) in your browser, you will actually see the Web driver manager running in the background.
  • Sample AngularJS application testing using Protractor

Protractor needs two files to run, a spec file and configuration file.

Configuration file: This File helps protractor to where the test files are placed (specs.js) and to talk with Selenium server (Selenium Address). Chrome is the default browser for Protractor.

Spec file: This File contains the logic and locators to interact with the application.

Configuration file:

// An example configuration file.

exports.config = {

directConnect: true,

// Capabilities to be passed to the webdriver instance.

capabilities: {

‘browserName’: ‘firefox’


// Framework to use. Jasmine is recommended.

framework: ‘jasmine’,

// Spec patterns are relative to the current working directory when

// protractor is called.

specs: [‘Example_spec1.js’],

// Options to be passed to Jasmine.

jasmineNodeOpts: {

defaultTimeoutInterval: 30000



Spec file:(This is the sample script which is by default present in our directory)

describe(‘angularjs homepage’, function() {

it(‘should greet the named user’, function() {



var greeting = element(by.binding(‘yourName’));

expect(greeting.getText()).toEqual(‘Hello Julie!’);


describe(‘todo list’, function() {


beforeEach(function() {


todoList = element.all(by.repeater(‘todo in todoList.todos’));


it(‘should list todos’, function() {


expect(todoList.get(1).getText()).toEqual(‘build an AngularJS app’);


it(‘should add a todo’, function() {

varaddTodo = element(by.model(‘todoList.todoText’));

varaddButton = element(by.css(‘[value=”add”]’));

addTodo.sendKeys(‘write a protractor test’);;


expect(todoList.get(2).getText()).toEqual(‘write a protractor test’);




  • Execution of the Code

To begin with, we will change the registry way or explore the envelope where the conf.js and spec.js are set in our framework.

Follow the following step.

  1. Open the command prompt.
  2. Make sure selenium web driver manager is up and running. For that give the command as “webdriver-manager start” and hit Enter.
  3. Open a new command prompt and give the command as “protractor conf.js” to run the configuration file.

(Reference link:

GraphQL With Ruby

08 May 2018

GraphQL With Ruby

Now a day’s most of the web or mobile applications fetch data from server which is stored in a database. REST API provides an interface to stored data that require by the applications. GraphQL is a query language for REST API's not for server databases.

It is database agnostic and effectively can be used in any context where an API is used. GraphQL provide platform for declarative data fetching where client need to specify what data needs from API in response.

Instead of multiple endpoints that return fixed data structures, a GraphQL server only exposes a single endpoint and responds with precisely the data a client asked for. GraphQL minimizes the amount of data that needs to be transferred over the network and improves applications operating under these conditions.

Introduction to GraphQL API on Ruby on Rails

  1. Start with adding gem in Gemfile
gem ‘graphql’
  1. Run command
bundle install
  1. Run command
rails generate graphql:install

Above command will add graphiql-rails in installation.
Let Post API where clients can get post and create post.
The post has an ID, title and description, goes into app/graphql/types/post.rb

Post = GraphQL::ObjectType.define do
name 'Post'
description 'Post creation'
field :id, !types.Int

The GraphQL ID type is a string, so we use Int.
GraphQL defines a schema with queries (eg. get post) and mutations (eg. create a post), which typically goes into app/graphql/schema.rb.

Schema = GraphQL::Schema.define do
query Query
mutation Mutation

The query root returns an post by ID, implemented in app/graphql/queries.rb.

Query = GraphQL::ObjectType.define do
name 'Query'
field :post, Post do
argument :id, !types.Int
description 'Get an post by ID.'
resolve ->(_obj, args, _ctx) {

A mutation creates posts in app/graphql/mutations/create_post_mutation.rb. Use Relay, a data fetching framework that makes it easy.

CreatePostMutation = GraphQL::Relay::Mutation.define do
name 'createPost'

input_field :title, !types.string
input_field :description, !types.string
return_type Post

resolve ->(_object, inputs, _ctx) {
id: 2,
  1. GraphQL Controller

GraphQL accepts a single JSON payload via POST in a typical Rails controller in app/controllers/graphql_controller.rb.

class GraphqlController < ApplicationController
def execute
result = Schema.execute(
variables: variables,
context: context,
operation_name: operation_name
render json: result

def query

def operation_name
def context
def variables
  1. Set routes in config/routes.rb
Rails.application.routes.draw do
post '/graphql', to: 'graphql#execute'
  1. Start the rails application

using rails s

and type  http://localhost:3000/graphql   in browser for local environment for rails.

What is SearchKick Gem?

Searchkick Gem is a Ruby on Rails gem that runs on top of Elasticsearch and makes it easy searches in a Rails-friendly fashion. Searchkick supports the complete Elasticsearch Search API, as by using it our search becomes more advanced. In addition, it allows you to add more features including analytics, auto suggestions, and personalized results.

The steps are required:

  1. Add the gem “gem ‘searchkick’.
  2. Then run the bundle install command.

Then we will generate the complete model by using Scaffold generator

rails g scaffold Article name:string description:text

After running the above command it will generate all the necessary files then we will run the database migration command.

rake db:migrate

The controller code will be modified like that

Def index
	Query=params[:q].presence || “*”
		page: params[:page}, per_page: 25

The model code will be modified like that

def search_data
title: title

The view code for display the articles will be modifeid like these.

Before starting the application we need to create the indexes

rake searchkick:reindex CLASS=Article

The ouput of the application look like these.

Step 1: First install postgres in Ubuntu system using following commands.

$  sudo apt-get update
$  sudo apt-get install postgresql postgresql-contrib libpq-dev

To check psql (postgres) version.

$  psql –version

Step 2:  Now to create root user and password for psql.

$  sudo -u postgres createuser -s root
$  sudo -i -u  postgres

Now, you are in postgres environment.


Now, use the following command to enter and manage psql.

postgres@admin:~$  psql

Now, set the password for psql username “root”.

postgres=# \password root
enter password

Now, you can exit from psql using following command

postgres=# \q

Step 3:  Create new user and database in psql

$ sudo su postgres
$ psql -c "create user mack with password 'mack'"
$ psql -c "create database mackdb owner mack"
$ sudo -i -u postgres
postgres@admin:~$  psql

Step 4:  Give all privileges over database to a particular user.

postgres=# grant all privileges on database mackdb to mack

You might be face this type of error while rakedb:create

PG::InsufficientPrivilege: ERROR: permission denied for relation schema_migrations rakedb:create


To list all the users of psql.

postgres=# \du

To list all the databases of psql.

postgres=# \l

Step 5:  Take backup or dump file to the database.

$ sudo su postgres

To take the backup of psql database

postgres@admin:~$ pg_dump dbname > outfile

To dump into psql database. Go to particular directory where the dump file is present enter following command

postgres@admin:~$  pg_restore dbname < infile

This is all about postgres. Hope this is helpfull.

Thank You.

  • The best_in_place gem is the easiest solution for in place editing in Ruby on Rails.
  • This gem provides functionality of “in place editing” in ruby on rails without writing any extra ajax code.
  • It supports text inputs, textarea, select dropdown, checkboxes, jQuery UI Datepickers, etc.
  • Also Displays server-side validation

Installation Steps of “best_in_place” Gem :

Installing best_in_place is very easy and straight-forward. Just begin including the gem in your Gemfile:

gem ‘best_in_place’

After that, specify the use of the jquery and best in place javascripts in your application.js, and optionally specify jquery-ui if you want to use jQuery UI datepickers:

 //= require jquery
//= require best_in_place

//= require jquery-ui
//= require best_in_place.jquery-ui

Then, just add a binding to prepare all best in place fields when the document is ready:

$(document).ready(function() {
  /* Activating Best In Place */

You are done!

I have created a sample DemoApp in which I have done couple of changes in code as:

  1. users/show.html.erb:

<p id=”notice”><%= notice %></p>



<%= best_in_place @user, :name %>




<%= best_in_place @user, :email %>




<%= best_in_place @user, :address, :as => :textarea, :ok_button => ‘Save’, :cancel_button => ‘Cancel’ %>




<%= best_in_place @user, :gender, :as => :select, :collection => [[“Male”,”Male”],[“Female”,”Female”]] %>




<%= best_in_place @user, :subscribe, as: :checkbox, collection: {false: “No”, true: “Yes”} %>


    1. app/assets/stylesheets/users.scss
	position: fixed;
	top: 30px;
	right: 100px;
	width: 250px;
	padding: 20px;
	background-color: #FCC;
	border: solid 2px #C66;
	&:first-letter { text-transform: uppercase; }

Following are the snapshots of various scenarios:

  1. initial page:

  1. Editing in place Name Field:

  1. Address TextField as in place textfield with Save and Cancel Button.

  1. Gender field as in place Select Dropdown

  1. Server side errors using in best_in_place. In example it triggered when email is duplicate.

The details about this gem is given on :


16 Apr 2018

What is Django?

Django not only used for making websites, rather than it is used for creating web applications. Django can be used to create dynamic high-security web applications.

Django is an open source web application framework, written in Python. A web framework that is a set of components that helps to develop websites faster and easier.

For authentication, one of the most powerful parts of Django is the automatic admin interface. It reads metadata from your models to provide a quick, model-centric interface.

Django Design Principles:

  • Less Coding: Less code so in turn a quick development.
  • Don’t Repeat Yourself (DRY): everything should be developed only in exactly one place instead of repeating it again and again.
  • Fast Development: Django’s philosophy is to do all it can to facilitate hyper-fast development.
  • Clean Design: Django strictly maintains a clean design principle. throughout its own code and makes it easy to follow best web-development practices.
  • Loosely Coupled: Django aims to make each element of its stack independent of the others.

How to start Django Project:

Step 1: django-admin startproject mysite

Step 2: python startapp webapp

Step 3: To create the first view,

Open the file webapp/

We import the class HttpResponse from the django.http module to render to the specific html pages.

The view returns an HttpResponse object that contains the generated response. Each view function is responsible for returning an HttpResponse object.

Step 4: In the next step to specify the root, URLconf at the webapp/ path,

we need to write:

We have specified the paths for admin, index and home.

Step 5: To run the app, we have to write:

$ Python runserver

Step 6: For migration, to create the tables in the database, we need to write the command:

$ Python migrate

Step 7: To create the models we will write:

here we have created models for Question, Choice and Board.

Finally the output is:

Action Mailer is the Rails component that enables applications to send and receive emails. In Rails, emails are used by creating mailers that inherit from “ActionMailer::Base” in app/mailers. Those mailers have associated views that appear alongside controller views in app/views.


Now we will build a rails application which will send an email to the user when a new user is created. Let’s create a new rails application.

$ rails new sample_app
$ cd sample_app
$ rails generate scaffold user first_name:string last_name:string   phone_number:string email:string
$ rake db:migrate

Action Mailer- Configuration:

Following are the steps you have to follow to complete your configuration before proceeding with the actual work.

We will just add following lines of code in  config/environments/development.rb

config.action_mailer.delivery_method = :smtp

#It tells ActionMailer that you want to use the SMTP server.

Generate a Mailer :

We now have a basic application, let’s make use of ActionMailer. The mailer generator is similar to any other generator in rails.

$ rails g mailer example_mailer

#This will create a example_mailer.rb in the app\mailer directory.

Now we open up app/mailers/example_mailer.rb and add a mailer action that sends users a signup email.


Now let’s write the mail we want to send to our users, and this can be done in app/views/example_mailer. Create a file sample_email.html.erb which is an email formatted in HTML.


We also need to create the text part for this email as not all clients prefer HTML emails. Create sample_email.text.erb in the app/views/example_mailer directory.


Now in the controller for the user model app/controllers/users_controller.rb, add a call to ExampleMailer.send_signup_email when a user is saved.


That’s it! When a new user object is saved, an email will be sent to the user via SendGrid.

Using JWT in Rails

03 Apr 2018

JWT is a Json Web Token, it is a standard and has been implemented in almost all popular programming languages. Hence, they can be easily used or exchanged in systems implemented in diverse platforms.

JWT has libraries for almost all platforms and Ruby is no exception.

Now we will see how JWT is used in Rails:

We will create a simple Rails application which uses the excellent Devise gem for authentication and the jwt gem for creating and verifying JWT tokens.

Let’s create a sample Rails application:

rails new rails_on_jwt

Once the application is generated, create a Home controller which we will use to check our authentication.

Create  home_controller.rb in the app/controllers

classHomeController ApplicationController
	def index

Write the route for  HomeController to /home in config/routes.rb:

Rails.application.routes.draw do
get 'home' => 'home#index'

Now, add Devise to our application. First, we will add the Devise and jwt gems in our Gemfile.

gem 'devise'
gem 'jwt'

Then run a command “bundle install” on terminal.

Now let’s create the Devise configuration files:

For that we have will have to create the Devise User model and migrate the database:

rails g devise User

Created User Model use for  It’s time to integrate jwt into our application. First, we will create a class named JsonWebToken in lib/json_web_token.rb.This class will encapsulate the JWT token encoding and decoding logic.

JWT.encode(payload, Rails.application.secrets.secret_key_base)

defself.decode(token), Rails.application.secrets.secret_key_base)[0])

We have to create an initializer for including the JsonWebToken class in config/initializers/jwt.rb.

require 'json_web_token'

We have to add some helper method in ApplicationController class which we will use in AuthenticationController class:

In app/controllers/application_controller.rb:

attr_reader :current_user

renderjson: { errors: ['Not Authenticated'] }, status: :unauthorized
    @current_user = User.find(auth_token[:user_id])
rescue JWT::VerificationError, JWT::DecodeError
renderjson: { errors: ['Not Authenticated'] }, status: :unauthorized

      @http_token ||= if request.headers['Authorization'].present?
request.headers['Authorization'].split(' ').last

    @auth_token ||= JsonWebToken.decode(http_token)


We have added a few helper methods like authenticate_request!which will act as a before_filter to check user credentials and we have created AuthenticationController to handle all authentication requests to the API. In app/controllers/authentication_controller.rb:

user = User.find_for_database_authentication(email: params[:email])
renderjson: payload(user)
renderjson: {errors: ['Invalid Username/Password']}, status: :unauthorized
def payload(user)
return nil unless user and
auth_token: JsonWebToken.encode({user_id:}),
user: {id:, email:}

Here we have added AuthenticationController to implement the authentication endpoint. It uses Devise to authenticate the user and issue a JWT if the credentials are valid.

Now we have to update our routes.rb to add the authentication endpoint.

Rails.application.routes.draw do
post 'auth_user' => 'authentication#authenticate_user'
get 'home' => 'home#index'

Also, we have to modify the HomeController to secure it using a before_filter and add a meaningful response in case of successful authentication:

before_filter :authenticate_request!
def index
renderjson: {'logged_in' => true}

Now, create a sample user to test the authentication by using rails console or by Using Seed command:Start the server and check out how JWT authentication works:

rails s


Sometimes the rails application requires sending the bulk mails using action mailers on the single attempt. The user can be able to send them seamlessly. But, this task is not possible in synchronous way. This will affect whole application performance and will take a lot of time to load the respective pages.

To overcome this problem rails community have enormous kinds of solutions. Among them  sidekiq is the best choice to overcome this kind of problems.

The sidekiq is a full-featured background processing framework for Ruby. It aims to be simple to integrate with any modern Rails application and much higher performance than other existing solutions.

The Redisis an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperlog logs and geospatial indexes with radius queries.

The Action Mailer is a service provided by rails to send the mails on respective emails ids. To send an email we must have to invoke deliver method of actionmailer.

To send mails asynchronously we have to use the sidekiq.

Integration Setup:

Add sidekiq into your rails application by including it into your Gemfile and run the bundle command.


gem ‘sidekiq’

To run sidekiq, run the following command:

$ bundle exec sidekiq -d -L log/sidekiq.log -C config/sidekiq.yml(default development mode)

$ bundle exec sidekiq -d -L log/sidekiq.log -C config/sidekiq.yml -e production (production mode)

Sending Delayed Emails:

                Sidekiq provides asynchronous emails sending provision with Action Mailer. That will be performed by adding below three methods to the ActionMailer module.


The .delay method will call the action mailer method and add this mail into to DelayedMailer queue for processing.

                                For ex.,   NewsMailer.delay.newsmailer(@email)


Here, user can be proviode inerval time before sending emails asynchronously.

                                For ex.,   NewsMailer.delay_for(


Here, user can set the timestamp for sidekiq. Sidekiq will wait until the provided time to send the email.

For ex.,   NewsMailer.delay_until(

Sending Bulk delayed Emails:

The below example illustrated the way to send bulk emails.


Here., ApplicationMailer is a class have new_article_mail(article) method. We used .delay method to                           set the delay for sending mail asynchronously.

# Send an email to all the users if new project has been posted in website.

		def new_article_mail(article)
			@article = article
			all_users("New article added in GXP")
		def all_users(subject){ |user|
		       @user = user
		       send_mail(, subject).deliver

		def send_mail(email, subject)
		    mail to: email, subject: subject

Here, new_article_mail method has one more method all_users in which we are calling send_mail method for sending an email to the individual user.

What is Data scraping?

Website/Data  Scraping is a technique to operating large amounts of data from websites whereby the data is extracted and displayed in own sites or it can be stored to a File/Database. Data scraping is basically used where the websites does not provides API.

Some Applications do not provide API to collect records. For the same , Data Scraping technique is used.

The data can be scraped using Nokogiri Gem.

The steps are required:

  • Add the gem “gem ‘nokogiri’, ‘~> 1.8’, ‘>= 1.8.1'”.
  • Then run the bundle install
  • Add the “require ‘nokogiri'”, “require ‘open-uri'” line where you will write the code for the scraping.

The controller of the page will look like below:

The view of the code of view page will look like :

The result in our application will look like:

Mechanize Gem in rails

The Mechanize library is used for automating interaction with websites. Mechanize automatically stores and sends cookies, follows redirects, and can follow links and submit forms. Form fields can be populated and submitted. Mechanize also keeps track of the sites that you have visited as a history.

For the above site ,I have used Mechanize gem to scrap the data or search the record.

We are having the following Sample application running on the local

The steps required are:

  • Add the gem “gem ‘mechanize’, ‘~> 2.7’, ‘>= 2.7.5’“.
  • Then run the bundle install
  • Add require ‘mechanize’ in the controller.

The controller code to scrap the data using mechanize gem for search:

The output of the above scraping as would be seen on the console:

By using the mechanize gem we can select radio button as given below:[0].radiobutton_with(:id => “First_drop”).check

By using the mechanize gem we can see all input fields in the form.[0].fields

By using the mechanize gem we can also select the drop down value of the site.[0].field_with(:id => “country”).value = “Single”

By using the mechanize gem we can find the form content of the site.

form = => “search_form”)

By using the mechanize gem we can find the button as given.

button = form.button_with(:value => “Search”)

In the Mechanize gem, link_with method is available to make it simpler to fetch the random record link .

link = staff_data.link_with(text: ‘Random article’)

In the mechanize gem the click method instructs mechanize to follow the link

page =

By using the mechanize gem we can find the page title of the site.
Devise is a flexible authentication solution for Rails. It is a complete MVC solution based on Rails engines. It allows you to have multiple models signed in at the same time. It hashes and stores a password in the database to validate the authenticity of a user while signing in. The authentication can be done both through POST requests or HTTP Basic Authentication.
STEP 1. gem ‘devise’ install.
STEP 2. run bundle install
STEP 3. run rails generate devise:install
STEP 4. run rails generate devise:views
STEP 5. Here in this application we mainly need 2 models, one is member model and the other one is contact model. So now we are going to create our member model using devise:run rails generate devise member

The migration file will located in db/migrate/ devise_create_members.rb.

STEP 6. After that you should have to run rake db:create (For creating new database)

STEP 7. run rake db:migrate

Once you run the db:migrate command, rails will create a table called members with the following field that the Devise specified in the migration file. Check the tables have created successfully.

STEP 8. run the server by typing “rails server” and copy and paste the 1 and 2 address to your browser search bar.


STEP 9. run rails generate migration add_username_to_members username:string

we have to add the username to the sign-up form. This command will generate another migration file in your “db/migrate” directory.

STEP 10. run rake db:migrate

STEP 11. run rails generate model contact

Edit the migration file of contact and specify the 2 fields as shown below. Open db/migrate/ 20180312073055_create_contacts.rb

STEP 12. run  rake db:migrate

STEP 13. run  rails generate controller home

And then create a new index file for home controller like “app/views/home/index.html.erb” and then add the following

STEP 14. Once you have done, Open app/config/routes.rb

add the line

root :to =>’home#index’

STEP 15. run rails generate controller registration

Open “app/controllers/registration_controller.rb” and then edit the file as shown below

STEP 16. We have to mention the relationships between 2 models (member,contact). Here the relationship will be as follows.

Open_Filepath : app/models/member.rb

Open_Filepath : app/models/contact.rb

STEP 17. Now refer the registration controller file in app/controllers/registration, here after completing the registration & the values that the member entered is stored in the table successfully, I just redirected the member to the dashboard page. So we have to add that page to our home controller.

Open_Filepath : app/views/home/dashboard.html.erb

STEP 18. Open app/config/routes.rb and you have to specify this path in our routes.rb file

STEP 19. run “rails s” and go to http://localhost:3000 address to your browser search bar

Introduction to DevOps…

DevOps is a combination of Development (Software Development) and Operations (Software Productions/IT Operations…)

What is DevOps?

DevOps is not a technology or tool, it is a concept of behavior, and it is an extension of Agile Methodology.

The DevOps is a set of practices designed to overcome the gap between development, QA and Operations by effective communication and collaboration, incorporating continuous integration process with automated deployment.

DevOps helps to increase an organization’s speed to deliver applications and services. It allows organizations to serve their customers better and compete more strongly in the market.

There are four basic continuous processes in DevOps:

  • Continuous Integration
  • Continuous Delivery
  • Continuous Testing
  • Continuous Monitoring

Relationship between Agile and DevOps

Agile Development is an umbrella term for several iterative and incremental software development methodologies.

The most popular agile methodologies include Extreme Programming (XP), Scrum, Crystal, Lean Development, and Feature-Driven Development (FDD).

On the other hand, DevOps is about a culture where development, and operations collaborate to give maximum throughput and high-end outcomes.

Similar to Agile, there are ways through which DevOps can be implemented such as deep communication and automated deployment.

Agile is all about software development while DevOps deals with software development and operations.

Note: Therefore one thing is clear that DevOps is an extension of Agile methodology.

DevOps Lifecycle

DevOps is deep integration between development and operations. Understanding DevOps is not possible without knowing DevOps life cycle.

Here is a brief information about the Continuous DevOps life-cycle:

  • Development
    In this DevOps stage the development of software takes place constantly. In this phase, the entire development process is separated into small development cycles. This benefits DevOps team to speed up software development and delivery process.
  • Testing
    QA team use tools like Selenium to identify and fix bugs in the new piece of code.
  • Integration
    In this stage, new functionality is integrated with the prevailing code, and testing takes place. Continuous development is only possible due to continuous integration and testing.
  • Deployment
    In this phase, the deployment process takes place continuously. It is performed in such a manner that any changes made any time in the code, should not affect the functioning of high traffic application.
  • Monitoring
    In this phase, operation team will take care of the inappropriate system behavior or bugs which are found in production.

Software Tools for DevOps

As DevOps is the collaboration of Development, QA and Operations, it is obvious that a single tool cannot be adequate for all the needs. So there are multiple tools required in each stage to perform all the operations successfully.

Popular Tool for DevOps Automation:

  • Git : Version Control System tool
  • Jenkins : Continuous Integration tool
  • Selenium : Continuous Testing tool
  • Puppet, Chef, Ansible : Configuration Management and Deployment tools
  • Nagios : Continuous Monitoring tool
  • Docker : Containerization tool

How do all these tools work together?


This flow may vary from organization to organization as per the requirement.

  • Developers develop the code and this source code is managed by Version Control System tools like Git etc.
  • Developers send this code to the Git repository and any changes made in the code is committed to this Repository.
  • Jenkins pulls this code from the repository using the Git plugin and build it using tools like Ant or Maven.
  • Configuration management tools like puppet deploys & provisions testing environment and then Jenkins releases this code on the test environment on which testing is done using tools like selenium.
  • Once the code is tested, Jenkins send it for deployment on the production server (even production server is provisioned & maintained by tools like puppet).
  • After deployment It is continuously monitored by tools like Nagios.
  • Docker containers provides testing environment to test the build features

Let’s start with an example that you have two different tables called InternalEmail and ExternalEmail.


Id (integer) sender_id (integer) content (text) Subject (character varying) recipient_email (character varying) Status (character varying) created_at (timestamp without time zone) updated_at (timestamp without time zone)
1 52 internal_content_1 internal_subject_1 44 accepted 2016-10-21 00:49:24.991002 2016-10-21 00:49:24.991002
2 46 internal_content_2 internal_subject_2 43 rejected 2017-10-21 00:49:24.991002 2017-10-21 00:49:24.991002


Id (integer) sender_id (integer) content (text) Subject (character varying) receiver_id (integer) opened (boolean) created_at (timestamp without time zone) updated_at (timestamp without time zone)
1 44 external_content_1 external_subject_1 42 true 2014-10-21 00:49:24.991002 2014-10-21 00:49:24.991002
2 42 external_content_2 external_subject_2 41 false 2015-10-21 00:49:24.991002 2015-10-21 00:49:24.991002
3 32 external_content_3 external_subject_3 40 true 2016-10-21 00:49:24.991002 2016-10-21 00:49:24.991002

If you want to combine these two tables to get result set as given below

Id (integer) type (character varying) sender_id (integer) content (text) subject (character varying) receiver_id (integer) recipient_email (character varying) opened (boolean) status (character varying) created_at (timestamp without time zone) updated_at (timestamp without time zone)
1 external 44 external_content_1 external_subject_1 42   true   2014-10-21 00:49:24.991002 2014-10-21 00:49:24.991002
2 external 42 external_content_2 external_subject_2 41   false   2015-10-21 00:49:24.991002 2015-10-21 00:49:24.991002
3 external 32 external_content_3 external_subject_3 40   true   2016-10-21 00:49:24.991002 2016-10-21 00:49:24.991002
1 internal 52 internal_content_1 internal_subject_1   accepted 2016-10-21 00:49:24.991002 2016-10-21 00:49:24.991002
2 internal 46 internal_content_2 internal_subject_2   rejected 2017-10-21 00:49:24.991002 2017-10-21 00:49:24.991002

you can use SQL UNION. Unlike JOIN query, UNION combines data from two tables into new rows that means each row of result set will be from Table A or from Table B. Then store this UNION query as SQL view in database to be able to use it as database table and query on it as and when required to display data on UI. To create view of UNION query, add migration in rails.

$rails generate migration CreateInternalExternalEmailView

Generated migration file should look like this

class CreateLightboxTeamLightboxView < ActiveRecord::Migration
def up
execute <<-SQL
CREATE VIEW internal_external_emails AS
SELECT id, 'external' AS type, sender_id, content, subject, receiver_id, NULL AS  recipient_email, opened, NULL AS status, created_at, updated_at
	FROM external_emails
SELECT id, 'internal' AS type, sender_id, content, subject, NULL AS receiver_id,       recipient_email, NULL AS opened, status, created_at, updated_at
FROM internal_emails

def down
execute "DROP VIEW internal_external_emails"

In above migration file, I have used NULL AS for some columns because there is rule of UNION query that it must contain same number of columns with same datatype.

Above migration will create SQL view internal_external_emails in database.

You can generate model InternalExternalEmail to mention necessary associations in it.

internal_external_email.rb model will look like this

class InternalExternalEmail < ActiveRecord::Base
self.primary_key = 'id'
belongs_to :sender, class_name: :User
belongs_to :receiver, class_name: :User

Blockchain was the idea originally developed by a group of people known by the pseudonym, Satoshi Nakamoto. But since then, it has evolved into something greater, and the main question every single person is asking is: What is Blockchain?

By allowing digital information to be distributed but not copied, blockchain technology created the backbone of a new type of internet. It was originally designed for the digital currency named Bitcoin. Of course you have heard the term Bitcoin, Bitcoin is one of the most popular cryptocurrencies there are. That much popular Bitcoin has become and the main reason behind the tremendous success of bitcoin is Blockchain.

Do you know how to use the internet? Of course you do but you don’t know how it works, do you? Because you don’t need to know how the Internet works, just to use it.

Everyone who has invested in bitcoin is unknowingly using Blockchain. Just like the Internet, you don’t need to know how blockchain works to use it. However, having a basic knowledge of this new technology show why it’s considered revolutionary.

The basic idea behind this complex but useful technology is surprisingly very easy. Blockchain technology is a form of distributed ledger technology that changed the concept of money, with the advent of bitcoin over the past decade. Blockchain offers a database, spread over a network of computers around the world where all data is stored in an immutable and tamper-proof manner without the need of an intermediary party to ensure the trustworthiness of the data. This feature of the blockchain technology enabled bitcoin to be used as a peer medium of exchange as a replacement for conventional money without the need of middlemen such as banks, credit card companies, governments, etc.

This adoption of blockchain technology has today led to the rise of several cryptocurrencies like bitcoin to enter the mainstream economy as a replacement for conventional currencies for value transfer around the world.

“As revolutionary as it sounds, Blockchain truly is a mechanism to bring everyone to the highest degree of accountability. No more missed transactions, human or machine errors, or even an exchange that was not done with the consent of the parties involved. Above anything else, the most critical area where Blockchain helps is to guarantee the validity of a transaction by recording it not only on a main register but a connected distributed system of registers, all of which are connected through a secure validation mechanism.”

Ian Khan, TEDx Speaker | Author | Technology Futurist

A Distributed Database

Picture a spreadsheet that is duplicated thousands of times across a network of computers. Then imagine that this network is designed to regularly update this spreadsheet and you have a basic understanding of the blockchain.

Information held on a blockchain exists as a shared — and continually reconciled — database.

This way of using the network has obvious benefits. The blockchain database isn’t stored in any single location, meaning the records it keeps are truly public and easily verifiable.

No centralized version of this information exists for a hacker to corrupt. Hosted by millions of computers simultaneously, its data is accessible to anyone on the internet.

Blockchain has major advantages over centralized data-management systems.

  • Highly durable and Robust:

Blockchain technology is like the internet in that it has a built-in robustness. By storing blocks of information that are identical across its network, the blockchain cannot be controlled by any single entity and has no single point of failure.

  • Transparent and incorruptible:

The blockchain network lives in a state of consensus, one that automatically checks in with itself every ten minutes. A kind of self-auditing ecosystem, the network reconciles every transaction that happens in ten-minute intervals.

Data is embedded within the network as a whole, by definition it is public and in-turn the whole system is transparent.

No centralized version of this information exists for a hacker to corrupt. Hosted by millions of computers simultaneously, that is why the data cannot be corrupted.

To integrate the Instagram API in your website, you need you have to follow following process

  1. Log in to Instagram and open this page
  2. Click on the button «Register a New Client».
  3. Then Fill all the Mandatory fields, in Valid Redirect URIs specify your valid redirected URI and click «Register». Then click «Manage» button to obtain both Client ID and Client Secret of your just registered app.
  4. Use the Client ID and Client Secret to generate access token with this link You can find more info there as well.

A Short Introduction about sandbox mode

  • All newly created apps start in Sandbox Mode
  • Apps in Sandbox mode have access only to 20 latest media of an access token owner (and sandbox users invited to your app).
  • To avoid these restrictions you should send your app to approval.

We can get instagram feed in our website by two ways

  • By User ID
  • By a Username

How can we get Instagram feed in our website by Using User ID?

Following is the javascript code to get instagram feed into our website by using User ID

var token ='your access token',
 num_photos =5;// how much photos do you want to get
 url:''+userid+'/media/recent',// or /users/self/media/recent for Sandbox
 data:{access_token: token, count: num_photos},
 for( x{
 console.log(data);// send the error notifications to console


How can we get Instagram feed in our website by Using Username?

Following is the JavaScript code to get instagram feed into our website by using Username.

var token ='your access token',
 username ='vksbomen',// vksbomen - my username :)
 num_photos =4;
$.ajax({// the first ajax request returns the ID of user vksbomen
 data:{access_token: token, q: username},// actually it is just the search by username
 url:''[0].id+'/media/recent',// specify the ID of the first found user
 data:{access_token: token, count: num_photos},
 for(x in{

How to generate access token?

Follow the below link to generate your access token

To divide large number of records into multiple parts, we use pagination. It allows user to display a part of records only. Loading all records in a single page may take time, so it is always recommended to created pagination. In will_paginate-bootstrap gem integrates the Bootstrap pagination component. The usage for this is extremely simple and it magically works. So let’s take a look at adding this.

STEP 1. gem install will_paginate-bootstrap

STEP 2. Open app/controller/posts_controller.rb and it adds necessary parameters in the resultant collection of record to display pagination links in front-end (.erb).


  • :page- This is parameter sent in Query String. Based on this, which records are to be fetched is decided. i.e. Offset is decided
  • :per_page- This is Number of results that you want to fetch per page i.e. From offset (.erb)
  • limit – per page limit for the paginated result data
  • offset – current paginated data set -> to show current page


STEP 3. Open app/views/posts/index.html.erb for adding pagination links and also add bootstrap CDN links.

It will add pagination links like,  <-  Older 1 2 Newer->  on front-end.

STEP 4.  A collection of extensions for the database layer that enable paginated queries, and view helpers for popular frameworks that render pagination links. With proper combination of view helpers and CSS styling.

Number of Pages here 1, 2 is decided based on total numbers of records that you have in your database, the final result can look like this:

PAGE NO 1. (Paginated result data)

PAGE NO 2. (Paginated result data)

Artists or Bands create songs. These songs are recorded in the digital format like mp3, wav, aac etc. Every artist would like to promote their songs and make money out of it. This is possible by uploading the songs to different digital platforms like itunes, amazon, spotify. Listeners goto these websites to buy, download and listen to the songs. Each website send a revenue sheet with the amount that is collected by the digital platforms which are also called as DSP (Digital Service Provider). This is how an artist monetize the digital content created by him/her.

Digital Music Distribution

Know details of what music distribution is & how it works.

The process of uploading a song on a DSP is different for each DSP. Also keeping a track of revenue from each DSP is also time taking. Artists are more creative and do not like to spend a lot of time with the DSP in managing their contents. This creates a need of Music Distribution System.

Music Distribution System is one stop solution for uploading digital contents (songs) and managing the revenues. It has all the DSPs integrated in the system. The user can create an account on the application and upload the songs to be distributed. User can select the list of DSPs where the song is to be distributed and rest all is taken care by the application.

It uploads the songs and process the revenues at the end of the month. There are reports created that gives an insight on the performance of the songs on different DSPs.

Along with artists, labels can create an account and manage all their artists. They can also create a contract with the artist on the revenue sharing.  There are individual artist reports created along with cumulative label reports.

This all comes with a small fee and helps artist and labels in monetizing their digital contents which are their songs and albums.

How can my application share it's resources with another client? This is where the CORS, or Cross Origin Resource protocol comes in. CORS introduces a standard mechanism that can be used by all browsers for implementing cross-domain requests. The spec defines a set of headers that allow the browser and server to communicate about which requests are (and are not) allowed. CORS continues the spirit of the open web by bringing API access to all.

What is a cross-site request?

Cross-site HTTP requests are HTTP requests for resources from a different domain than the domain of the resource making the request. Such requests are subject to security-based restrictions. To handle this restrictions, and get around them in a secure manner, W3C developed CORS.

What is CORS?

The Cross-Origin Resource Sharing (CORS) mechanism provides a way for a server to support cross-site requests and enable the secure transfer of data across different domains/sites.

How can our Rails API utilize CORS?

When the API is not configured to respond to requests you will likely get the error “No ‘Access-Control-Allow-Origin’ header is present on the requested resource”. In other words, you won’t be able to call the API directly. So if you have your frontend and backend on different domains you’ll need to allow CORS (cross-origin HTTP request) with the rack-cors gem. This gem provides Rack CORS Middleware to our Rails app, allowing it to support cross-origin resource sharing.

Setting up Rack-CORS:

A few easy steps and we'll be ready to go!

    1. Add the following to your Gemfile and bundle install:
      gem 'rack-cors', :require=>'rack/cors’
    2. Then run bundle install
    3. Add your API module to config/application.rb and configure your Rack-CORS Middleware:
      classApplication <Rails::Application
          # Rails 5
          config.middleware.insert_before 0, Rack::Corsdo
            allow do
              origins '*'
              resource '*', :headers=>:any, :methods=>[:get, :post, :options]
          # Rails 3/4
          config.middleware.insert_before 0, "Rack::Cors"do
            allow do
              origins '*'
              resource '*', :headers=>:any, :methods=>[:get, :post, :options]
    4. With origins "*", we specify that our API will accept HTTP requests from any domain in the whole wide internet.
    5. With resource "*", we specify that a cross-origin request can access any of our resources.
    We then specify that a cross-origin request using any HTTP method will be accepted–although, if you recall, we defined our Graduates class inside our API module to respond to only requests for all grads or just one grad.

CKEditor is text editor basically used for transforming simple text field to dynamic word featured field that helps user to simplify web content creation. In this blog, we will learn how to use CKEditor gem and how to customize it in our Ruby on Rails Application.

Ckeditor Rails Gem

How to use it & customize in Rails application!

Follow some simple steps :

gem 'ckeditor'
Rails.application.config.assets.precompile += %w( ckeditor/*)
CKEDITOR.editorConfig = function (config) {

config.toolbar_mini = [

["Bold",  "Italic",  "Underline",  "Strike",  "-"],

['BulletedList','NumberedList' ],['Outdent','Indent'],


config.toolbar = "mini";

config.toolbarLocation = 'bottom';

config.height = 280;

config.width = 620;

config.removePlugins = 'elementspath';config.removePlugins = 'elementspath';

  1. Add 'ckeditor' gem to “Gemfile.rb” and run $ bundle command:
  2. Include following in your app's “config/initializers/assets.rb” file:
  3. Following, Include ckeditor javascripts in your “app/assets/javascripts/application.js” file:
    //= require ckeditor/init
  4. Then change simple text_area field to cktext_area in view file as follows:
    <%= f.cktext_area :template_text, placeholder: "Email Body Text" %>
  5. These will transform text field to Ckeditor. The basic Ckeditor will look like image as given below.
    VKeditor by cryptex technologies
  6. To customize CKEditor create “config.js” file in “app/assets/javascripts/ckeditor/” folder and add following code in it:
  1. The customized CKEditor will look like image as given below:

In many applications we need to provide the ability to like/dislike, upvote/downvote kind of functionalities and in order to implement this there is an awesome gem available in Ruby on Rails called “Acts as Votable” gem.These are the simple steps to follow:

Step 1: Create a sample App using scaffold.
Step 2: Add “acts_as_votable” gem to the Gemfile and install it by running bundle install command.
Step 3: This Gem uses vote table to save all voting information. To generate vote migration/ table, run below commands:
rails g acts_as_votable:migration
rake db:migrate
Step 4: For example I have a model called Movie, so I have added acts_as_votabe helper to it. But you can add the following to whatever model in your application which you want to make votable. In app/models/movie.rb, I have :

Also I need another model called User, who is going to vote. So in the app/models/user.rb, I have:

Step 5: For setting up the views to interact with the new functionality of voting I’ll need to add some routes. In app/config/routes.rb, I’ll need to add another block to my movies section.

Step 6: This block invokes the upvote and downvote methods in the movies controller, but those methods don't exist yet. So I’ll define those methods in the app/controllers/movies_controller.rb

Step 7: Finally I will create links in our views to like and dislike i.e. to implement the voting functionality in the browser.

This will create some basic links as like and dislike that, when clicked on, will update with the amount of respective upvotes or downvotes for each movie.

How blockchain works

Blockchain is a distributed database, which consists of two records:

  1. Individual transactions
  2. Blocks

Individual transactions consist of “Header” and “Data” which is related to transactions. Transactions take place for a given period of time. Block is used to create alphanumeric string called as “Hash”.When the first record is created, the next block takes previous block’s Hash for creation of their own Hash. This is authenticated or validated. At this point of the Blockchain process, a majority of nodes in the network must agree the new block’s hash is correctly calculated and ensures that all copies of the distributed ledger share the same state. Once block added, cannot be changed. If we try to change or swap that block, the hashes for previous and subsequent blocks will also change. The other computers in the network will also understand that problem and they will never add new block, until the problem is resolved. When the problem is solved they will start to add the block. If a problem is found in the block it will be not accepted and the process repeats.

Integration on Blockchain API with Rails:

To integrate blockchain api to exchange bitcoin from one wallet to another wallet.


To get the API key we have to first signup on the link

then we will get the API key, for e.g. :


Create API:

First need to create a wallet:

I have created the wallet in the method:


Description: This api is use to create blockchain wallet

# create_wallet: http://XXX.XXX.X.XX:3030/api/v2/create_wallet

# create_wallet:

Write the API method to check the wallet balance.

            wallet_address: “Address of the wallet”

            Confirmation: “Password”


Write API to send or receive bitcoin using guid.

	Guid: Uniq id of the user
	main_password: blockchain password
	second_password: blockchain second password
	to: Receiving address
	from: Sending address

make_payment_by_guid: http://localhost:3030/merchant/%{guid}/payment?password=%{main_password}&second_password=%{second_password}&to=%{address}&amount=%{amount}&from=%{from}


Description: “this api will use for getting bitcoin value as per the local currency.”

for ex., 1btc = ? (USD)

The following method is used to call the bitcoin exchange API using guid

# def self.transaction_by_guid(receiver_address, amount_in_btc, guid, main_pass, second_pass)

def self.receive_btc_by_guid(guid, sender_main_password, sender_second_password, to_wallet_address, amt_in_btc, from_wallet_address)

# convert btc to satoshi and add transaction fee

amount = (btc_to_satoshi(amt_in_btc))

# Prepare params

request_url = Bitcoinexchange::Application.blockchain[“api”][“make_payment_by_guid”] % {guid: guid || ”, main_password: sender_main_password || ”, second_password: sender_second_password || ”, address: to_wallet_address, amount: amount, from: from_wallet_address}

# If in response failure occurred using third party API or http client it generate error and return nil into the response

response =  begin

RestClient.get(request_url, {“Content-Type”: “application/x-www-form-urlencoded”})

rescue RestClient::ExceptionWithResponse => e



# If response is success(code == 200)

response_body = JSON.parse(response.body)

if response.code == 200


elsif response_body[“error”]!=””


# it gives the the converted value in BTC

# response_body = “#{response_b[“message”]}” +” to “+”#{response_b[“to”]}”+”successfully.”


# To raise the error if error occured in executing blockchain api

raise Exceptions::TransactionError::ParamsError, response.body



What is filterrific?

'filterrific' gem is used for filtering the data only. It is a Rails Engine plugin that makes it easy to filter, search, and sort your ActiveRecord lists.

Ruby On Rails Gem Filterrific

Features of filterrific gem:

    • It Integrates with pagination
    • Filters can be reset to default settings
    • Makes heavy use of ActiveRecord Scopes
    • API option to use Filterrific with Rails API mode. Just use gem 'filterrific', require: 'filterrific_api' in your Gemfile
    • ActionController helpers to shuttle filter params from ActionView forms to ActiveRecord based models, and to return matching records back from ActiveRecord to ActionView
    • It depends on ActiveRecord scopes for building DB queries
    • Can be used for HTML/JS/JSON/XML response formats
    • It is used to run filter settings from a filter UI to the controller and ActiveRecord
    • It persists filter settings in the HTTP session or DB for saved searches


  • Rails - 3.x and above
  • ActiveRecord 4 and above
  • jQuery and Asset pipeline for form observers and spinner

What I need to do?

  • Need to define ActiveRecord Scopes
  • Need to build and style filter form and record lists

How to use it?

Let us assume that we want to show the lists of ‘Students’ that can be filtered by application’s users. Step 1:

  • #Gem File
  • gem ‘filterrific’

Step 2: Add Filterrific to ‘student’ model:

 default_filter_params: { sorted_by: 'created_at_desc' },
 available_filters: [
 # define ActiveRecord scopes for
 # :search_query, :sorted_by, :with_country_id

Step 3: Use Filterrific in index method of StudentsController:

def index
 @filterrific = initialize_filterrific(
 ) or return
 @students =[:page])

respond_to do |format|

Step 4: Here's the lists of students' data is showing in the view. Lastly, the Filterrific ActionView API is used to create the views:

  • Basically it shows the list of matching records and the form to update filter settings via AJAX form submission
  • Also used to reset the filter settings

FFmpeg is an extremely powerful and versatile command line tool for converting any multimedia files. It is free and available for Windows, Mac and Linux machines. Whether you want to join two video files, extract the audio component from a video file, convert your video into an animated GIF, FFmpeg can do it all and even more.

FFmpeg command synopsis

ffmpeg [global_options] {[input_file_options] -i input_url} ... {[output_file_options] output_url} ...

Some Basic and Useful Commands

  • Cut video file into a smaller clip

ffmpeg -i videoplayback.mp4 -ss 00:00:50 -codec copy -t 20 output.mp4

  • Convert video from one format to another

ffmpeg -i videoplayback.mp4 -c:v libx264 filename.wav

  • Mute a video (Remove the audio component)

ffmpeg -i videoplayback.mp4 -an mute-video.mp4

  • Convert Video into Images

ffmpeg -i videoplayback.mp4 -r 0.25 frames_%1d.png

  • Convert a video into animated GIF

ffmpeg -i videoplayback.mp4 -vf scale=500:400 -r 5 -t 00:00:30 image.gif

  • Add subtitles to a movie

ffmpeg -i videoplayback.mp4 -i -c copy -c:v libx264 -crf 23 output.mkv

Steps to use FFmpeg commands in Ruby on Rails application:

  • FFmpeg must be installed in the system
  • Create .yml file in application to specify ffmpeg path as environment variable, you will get to know the ffmpeg path using command which ffmpeg in your system
  • You will have to specify ffmpeg command in rails application as system command Example is given below:

Syntax:- system("#{ENV['FFMPEG']} -i input.mp4 output.avi”)


Spree Commerce is a complete, scalable, API-driven open source Ecommerce framework. It is built with Ruby on Rails, empowering forward thinking developers for years. In 2018 Spree is a matured and market proven technology.

Spree is well suited to serve as a custom technology platform for any type of an Ecommerce application: an online shop, a multi vendor marketplace, a rich-content driven commerce project, a social commerce website or a backend engine for an Ecommerce mobile or tablet app (iOS, Android).

Spree allows you to design and develop a unique, beautiful front-end UX. On the backend it combines API driven omni-channel support with multiple stock location capability, enabling business scalability and flexibility.

Spree allows for rapid development and short time to market because its lean core functionality may be easily customized with a collection of official extensions, as well as hundreds of unofficial ones. By applying these extensions you may customize Spree to your specific use case, industry or a business model.

Integrating Spree using ruby on rails

    1. Prerequisites

Before integrating spree in our ruby on rails application we will require the following prerequisites.

      • Ubuntu OS(14.04 or higher)
      • Sublime text/ VScode(Editor)
      • Ruby 2.3.0 or higher
      • Rails 4.2 or higher
      • Database(MySql/Sqlite/psql)
      • Heroku setup(optional)
    1. Installation guide

The following steps will guide us how to integrate spree in our rails application.

  • Create ruby on rails application
  • For ex., rails new SpreeDemo -d
    database: Name of the database(mysql, psql etc)

  • Add the specific required gem in the gemfile.
    Rails 5.1
    gem 'spree', '~> 3.4.4'
    gem 'spree_auth_devise', '~> 3.3'
    gem 'spree_gateway', '~> 3.3'
    Rails 5.0
    gem 'spree', '~> 3.2.7'
    gem 'spree_auth_devise', '~> 3.3'
    gem 'spree_gateway', '~> 3.3'
    Rails 4.2
    gem 'spree', '~> 3.1.12'
    gem 'spree_auth_devise', '~> 3.3'
    gem 'spree_gateway', '~> 3.3'
    • Run the following rake commands and generator commands.
      1. bundle install
      2. Use the install generators to set up Spree:
  • rails g spree:install --user_class=Spree::User
    rails g spree:auth:install
    rails g spree_gateway:install
        • Rake setup
    bundle exec rake railties:install:migrations
    bundle exec rake db:migrate
    bundle exec rake db:seed
    bundle exec rake spree_sample:load

    1. Customization
  • To meet the business requirement we have to override/ extend the classes and views.
  • Standard practice for including such changes in your application or extension is to create a file within the relevant app/models/spree or app/controllers/spree directory with the original class name with _decorator
  • Adding a custom method to the Product model:
    Spree::Product.class_eval do
    def some_method

  • Adding a custom action to the ProductsController:
    Spree::ProductsController.class_eval do
    def some_action
  • You can export all views from spree frontend into your application using rails generate spree:frontend:copy_viewsThis is the recommended way of customizing views in Spree.
  1. Websites built in Spree
  2. Market Statistics
    This is the APR-2017 market statistics. This market statistics shows the difference between shopify and spree commerce. The difference is due to its use and handling. The shopify eCommerce store can be created and published by anyone. But, spree commerce have to be integrated and published manually by application programmers(web developers). spree-commerce
  3. Advantages
    • Easily customizable construction allowing users to create the ideal store for their business.
    • Light, fast, and flexible with a powerful backend admin module.
    • Comprehensive support package plus Ruby on Rails community offers solid and reliable support.
    • Spree officially maintains many extensions to provide additional functionality that isn’t available out of the box.
    • Fast and easy integrations with third-party solutions
  4. Disadvantages
    • Coding skills or technical assistance are needed.
    • Currently, only a handful of themes is available.
    • In some cases, some “common” functionality may require custom development.
      This platform doesn’t provide any support in a traditional sense, but still, you can find a forum and tons of useful documentation on the web. Plus, there’s a Ruby on Rails community which maintains Spree, making it stable, multi-functional and free.
  5. Screenshots

    Admin Page:

    Front End:
  6. Reference

What is Docker?

Docker is the world's leading software container platform. Docker is a tool designed to make it easier to deploy and run applications by using containers. Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and ship it all out as one package.

Where does Docker operate?

  1. Design
  2. Development
  3. Deployment
  4. Testing/Release

Docker makes the process of application deployment very easy and efficient and resolves a lot of issues related to deploying applications.

  • Build application only once:

An application inside a container can run on any system that has Docker installed. So there is no need to build and configure application multiple times on different platform.

  • More Sleep and Less Worry

With Docker you test your application inside a container and ship it inside a container. This means the environment in which you test is identical to the one on which the application will run in production.

  • Portability

Docker containers can run on any platform. It can run on your local system, Amazon ec2, Google Cloud platform, Rackspace server, Virtual box... etc.

  • Version Control

Like Git, Docker has in-built version control system.

Docker container work just like GIT repositories, allowing you to commit changes to your Docker images and version control them.

  • Isolation

With Docker, every application works in isolation in its own container and does not interferes with other applications running on the same system. So multiple containers can run on same system without interferes. For removal also you can simply delete the container and it will not leave behind any files or traces on the system.

  • Productivity

Docker allows faster and more efficient deployments without worrying about running your application on different platform.

How to Install Docker in Linux?

  1. Connect to Linux Connect with AWS or other
  2. Install Docker sudo yum -y update sudo yum install -y docker
  3. Start Docket sudo service docker start sudo usermod -a -G docker ec2-user(This is optional)
  4. Stop Docker sudo service docker stop

For more information-> go to

Many beginners want to deploy their simple application on production environment, but they do not get any free cloud service. So what they can do? Well, there is a solution provided by Heroku. Heroku is a cloud platform as a service supporting several programming languages that is used as a web application deployment model.

Before starting deployment, we need four things Git version control, SSH key, Bit-bucket remote repository and Heroku account. If you don't have any one of these, don't worry.

So, let’s get started!

Step 1. Install Git version control system.

  • To install git on your system, go ahead and download latest version of Git, follow the instructions to install Git.
  • To verify the installation was successful, open terminal or command prompt and type git --version. It will look like this.
$ git –version

git version 2.9.2

  • If you have installed Git first time you need to create username and email using below commands.
             $ git config --global "Foo Bar"             
             $ git config --global

Congratulation! you have Git on your system. The next step is to create Ruby on Rails application.

Step 2. Create Ruby on Rails application.

  • If you are new to Ruby on Rails, visit Rails Guides and create simple blog application.
  • In root directory of project run $ git init to initialize new repository. Add all the project files to repository using command $ git add -A.
  • To tell Git we want to keep the changes, we use the commit command.
             $ git commit –m “Initialize repository”

Step 3. Setup Bit-bucket remote repository.

You also can use GitHub remote repository, but there is a problem, GitHub does not provide free private repositories while Bit-bucket does.

  • Sign up for a Bit-bucket account if you don’t already have one.
  • We need SSH key to use Bit-bucket, so how to get and install SSH key in Bit-bucket account.
  • Add your public key to Bit-bucket by clicking on the avatar image. Select “Bit-bucket settings” and then “SSH Keys”.
  • Once you’ve added your public key, click on ‘+’ sign to create a new repository, make sure “This is a private repository” checked and select "include a README" to No.
  • Now we are going to push our project to the Bit - bucket. The below commands first tell Git that you want to add Bit-bucket as the origin for your repository, and then push your repository up to the remote origin. To find the remote origin URL has gone to bit-bucket -> open repository created in previous steps -> scroll down and choose "I have an existing project".
            $ git remote add origin
            $ git push -u origin –all

Step 4. Deploy application to Heroku.

Heroku uses the PostgreSQL as production database, which means that we need to add the 'pg gem' in the production environment to allow Rails to talk to PostgreSQL. Open Gem file and below group.

group :production do
gem 'pg', '0.20.0'

To prepare the project for deployment, we run bundle install with a special flag to prevent the local installation of any production gems.

$ bundle install --without production

Next, we have to create and configure a new Heroku account.

  • The first step is to sign up for Heroku. Then check to see if your system already has the Heroku command-line client installed. If you don't have Heroku installed. Install it using Heroku Toolbelt.
            $ heroku version
  • Once you’ve verified that the Heroku command-line interface is installed, use the Heroku command to log in and add your SSH key.
            $ heroku login
            $ herokukeys:add
  • Finally, use heroku create command to create a place on the Heroku servers for the app to live.
             $ heroku create
  • To deploy the application use Git to push the master branch up to Heroku.

To see your newly deployed application, visit the address that you saw when you run heroku create.

After creating REST API, it’s important that API should be documented, so the others can use the documentation and understand the requirement and implementation of API.

Swagger documentation provides the interface to REST APIs which allows people and system to understand the API without access to source code.

Use ‘swagger-docs’ gem to document the API.

This will generate swagger-ui json files for rails apps with APIs specification that can be used by person to know about the APIs.

To start create swagger_docs.rb file in config/initializers and define your APIs as below:

"1.0" => {
:api_extension_type =>:json,
# path for .json files 
:api_file_path =>"public",
:base_path =>"",
:clean_directory =>false,
:attributes => {
:info => {
"title" =>"Swagger Sample App",

Swagger document contain the json controller which has the API swagger_controller directives.

For example ItemsController has the API specification

render:json => {result:"Success"}, :status =>200


Run rake task to generate docs

Rake swagger: docs

Above command examines your controllers to determine which controllers should be documented for swagger-ui.

Generate the api-docs.json output in public folder which contains the API specification for the items_swagger controller.

Breadcrumbs are graphical control element used as navigational aid in user interfaces. Today I am going to explain how it can be implemented in Ruby on Rails in simple steps as follows:

Step 1: Create a sample app using scaffold

Step 2: Add"breadcrumbs_on_rails" gem to the Gemfile and install it.

Step 3: Create a home.html.erb in articles for home page and route for it.

--> app/views/articles/home.html.erb



This is the home page of Sample Article

<%= link_to "Articles", articles_path%>

--> config/routes.rb

root 'articles#home'


Step 4: Add breadcrumb for home page.

In Articles Controller create method “add_breadcrum” to set the braedcrumb for home path like this:

--> app/controllers/articles_controller.rb


add_breadcrumb "Home".html_safe


For every view page set home page as the first breadcrumb in articles controller by the default using:

before_action :add_breadcrum

Step 5: Add breadcrumb for other pages of article like index, create, edit and show in articles controller by adding the line for breadcrumb as “add_breadcrumb ...........”.

--> app/controllers/articles_controller.rb

def index

@articles = Article.all

add_breadcrumb "Index".html_safe



def new

@article =

add_breadcrumb "Index".html_safe

add_breadcrumb "Create".html_safe



def edit

add_breadcrumb "Index".html_safe

add_breadcrumb "Edit: #{@article.title}".html_safe



def show

add_breadcrumb "Index".html_safe

add_breadcrumb "Show: #{@article.title}".html_safe



Step 6: To add seprator “/” and show breadcrumb to view page we will render the breadcrumb

<%= render_breadcrumbs :separator => " / " %>

I have seen many developers that are looking for creating "Drag and Drop" functionality in Ruby On Rails technology. So I'm going to brief about a sample to create and implement this functionality using JQuery Rails, JQuery UI Rails and Rails Sortable gems. Given below are simple steps required to create the rails application:

Ruby On Rails Programming

How to create Drag and Drop functionality in Ruby on Rails?

First of all we will create a simple application first to create the products.

    1. The first Step we required to create the Rails Application.
      $ rails new SampleSortRails
    2. By using the scaffold we will generate the the MVC components needed for Simple Products application form
      $ cd SampleSortRails
      $ rails g scaffold Product name:string description:text quantity:integer price:integer sort:integer
    3. Create the Products database table:
       $ rake db:create
      $ rake db:migrate
      Rails uses rake commands to run migrations. Migrations are Ruby classes that are designed to make it simple to create and modify database tables. Rails uses rake commands to run migrations.
    4. Then we need to set routes of our application.
      $ rake routes
           Prefix Verb   URI Pattern                  Controller#Action
              products GET    /products(.:format)          products#index
                       POST   /products(.:format)          products#create
           new_product GET    /products/new(.:format)      products#new
          edit_product GET    /products/:id/edit(.:format) products#edit
               product GET    /products/:id(.:format)      products#show
                       PATCH  /products/:id(.:format)      products#update
                       PUT    /products/:id(.:format)      products#update
                       DELETE /products/:id(.:format)      products#destroy
                  root GET    /                            products#index
      sortable_reorder POST   /sortable/reorder(.:format)  sortable#reorder
    5. In the routes.rb file then we will set the routes of our application.
      Rails.application.routes.draw do
        resources :products
        root 'products#index'
    6. We have made the simple application for products CRUD operation for adding the Drag and drop functionality in the Application we need to follow some steps and need to do Setup .
      First of all we need to add the gem files in the application in the gem file.
      gem 'jquery-rails'
      gem 'jquery-ui-rails'
      gem 'rails_sortable'
    7. Then we need to run the bundle install command.
       $bundle install
    8. And then We need to add the following to the asset pipeline in the application.js:
      //= require jquery
      //= require jquery_ujs
      //= require jquery-ui/widgets/sortable
      //= require rails_sortable
    9. We have already run the migration command our database migration command look like this.
      class CreateProducts < ActiveRecord::Migration[5.1]
        def change
          create_table :products do |t|
            t.string :name
            t.text :description
            t.integer :quantity
            t.integer :price
            t.integer :sort
    10. The product model look like this
      class Product < ApplicationRecord
        include RailsSortable::Model
        set_sortable :sort
    11. In the controller index method we only need to change one line.
      class ProductsController < ApplicationController
        def index
          @products = Product.order(:sort).all
    12. Normally The view of index page always look like this we only need to change some part of code
          <% @products.each_with_sortable_id do |product, sortable_id| %>
            id="<%= sortable_id %>">
              <%= %>
              <%= product.description %>
              <%= product.quantity %>
              <%= product.price %>
              <%= product.sort %>
              <%= link_to 'Show', product %>
              <%= link_to 'Edit', edit_product_path(product) %>
              <%= link_to 'Destroy', product, method: :delete, data: { confirm: 'Are you sure?' } %>
            <% end %>
    13. In the Application.js file we need to add the Javascript function
      $(function() {
    14. Then we need to start the server.
      $rails s
    Feel free to ask any queries.

Elastic-search is a platform for distributed search and analysis of data in real time. Its popularity is due to its ease of use, powerful features, and scalability. Today I am going to brief about the advantages of using elastic-search. It is as follows:


What are Elastic-search Advantages

    • Schema Free
    • Full text search
    • Document oriented
    • Rest full API Support
    • Built on top of Lucene
    • Elastic search is very fast
    • DataBase: Mysql, postgress
    • Elastic-search uses JSON objects as responses, which makes it possible to invoke
    • Elastic-search server with a large number of different programming languages
    • Elastic search is developed on Java, which makes it compatible on almost every platform
    • Elastic search is real time, in other words after one second the added document is searchable in this engine
    • Elastic-search supports almost every document type except those that do not support text rendering
    • Elastic-search lets you perform and combine many types of searches — structured, unstructured, geo , metric — any way you want. Start simple with one question and see where it takes you
    • It’s one thing to find the 10 best documents to match your query. But how do you make sense of, say, a billion log lines? Elastic-search aggregations let you zoom out to explore trends and patterns in your data
    • Elastic search is distributed, which makes it easy to scale and integrate in any big organization. Creating full backups are easy by using the concept of gateway, which is present in Elastic-search. Handling multi-tenancy is very easy in Elastic-search when compared to Apache Solr

Code cleanup refers to the act of writing code so that it cleans up leftover data structures and other unwanted materials from memory and the file system. It is not the same as refactoring code, which involves making the source code itself easier to understand, maintain, and modify. TraceRoute is the tool helpful for code cleanup.

Integrate this gem in the Rails application by putting this gem into gem file.

Traceroute is a route cleaning tool for Rails applications. It provides a simple rake task for checking which routes are mapped to non existing controller actions, and finds out which controller actions are not reachable.

The following steps with the description implements Traceroute for code cleanup using traceroute gem in our ruby on rails application easily.

STEP 1. gem install traceroute

STEP 2. Bundle Install

STEP 3.Type rake traceroute in command prompt and press Enter. List will appears with unused routes and unreachable action methods.

Sorting, searching and paginating data has always been one of the requirements of a Rails application.DataTable gem provides a jQuery Javascript library - Highly flexible tool, based upon the foundations of progressive enhancement which will add advanced interaction controls to any HTML table.

Integrate this gem in the Rails application by putting this gem into gemfile.

DataTables makes it easy to convert a plain HTML table into one with pagination, sorting, and searching - all done with JavaScript or jQuery. Instead of writing searching functionality, sorting functionality and pagination functionality separately, these functionalities are conveniently performed by using datatable gem.

Sorting data is inbuilt so instead of sortable_table gem use datatable gem and all columns are sortable in ascending and descending order.

In some cases, we have to hide searching, pagination functionality in table. For hiding pagination functionality we have to write "bPaginate": false and for hiding searching functionality we have to write "searching": false.

When you reload the page,you can see your listing page in better UI with sorting searching and pagination functionality.

The following steps with the description implements sorting,searching and pagination for particular table using datatable gem in our ruby on rails application easily.

STEP 1. gem install jquery-datatables-rails

STEP 2. Open app/assets/javascript/application.js and write : //= require dataTables/jquery.dataTables

STEP 3. Open app/assets/stylesheets/application.css and write : *= require dataTables/jquery.dataTables

STEP 4. Provide id for a particular table.) (table class="table table-bordered table-striped" id="myTable"

STEP 5. Call this table id by jQuery DataTable() function.

Sample Code:

table class="table table-bordered table-striped" id="myTable"

script type="text/javascript"





Crypto currency, virtual currency, digital currency no matter you selected to choose it, bitcoin includes a heap to supply the world, virtual consumers of nowadays. It's an internet based mostly payment system between 2 people or business entities. The network functions of bitcoin are while not the negotiator or central governing agency. It's gaining quality and momentum day by day within the on-line virtual world amongst techno-savvy folks all across the planet regardless of origins or professions.

The bitcoin payment entrance way has various edges like international accessibility, management against fraud, price potency, purpose of sale transactions, and super quick international payment. Another splendid feature of bitcoin transactions is that there's no limit on the quantity that may be transferred, thus it opens the flood gates of infinite business or personal transactions. The marvelous aspects of this payment entrance way are that it doesn't involve any middlemen, thus it doesn't levy any extra surcharges or negotiator charges on the users that is why it's gaining quality day by day. This doesn't permit developing any scope of fraud to occur at any purpose throughout the dealings. This mode of payment is secure and irreversible and provides an excellent sense of satisfaction and mental piece to the user and also the bitcoin merchants yet. Several online stores or shops that settle for bitcoin currency facet by facet with native currency, debit cards or credit cards, opens the window of chance for users to check the advantages of searching via bitcoin payment gateway.

As a bitcoin merchandiser, it permits to square out amongst the normal business merchants and earn respect from the bitcoin user community. Bitcoin payment entranceway has opened a inordinate of opportunities to the e-commerce world and has given flexibility to the merchant’s community yet on the user community severally. the largest USP (Unique commercialism Proposition) is that one will open its own on-line store and begin acceptive bitcoins because the payment entrance way for any physical or digital product or service.

Hence, victimization Bitcoin Payment entrance way has several blessings than not victimization it the selection is yours!

Give your web and mobile apps the power to exchange messages of any variety, from chat to SMS. You get global reach, delivery intelligence and the highest reliability over both IP and carrier networks, all with minimal development effort.

Here Twilio, is a cloud communications platform. We can able to use it in a various ways. It is specially available for the developers to get interact with the communication resources like., SMS, MMS, voice or video calls.

Twilio platform is available not only for ruby language but also for many kinds of programming languages like., C#.Net, Java, Python, PHP, Node, Android etc. The availability of the service is really good and easy for the developers perspective which bring something good for the developing application.

Using Twilio we can integrate SMS, MMS, or Voice and Video service in our developing application. It is just a couple of integration steps through which we can use the described services easily.

So, Lets start with the some programming language through which we can use it easily. The following steps with the description implements simple messaging service in our ruby on rails web application easily.


For implementing SMS service into our rails application by twilio we have to register freely onto Just after registration we will get the the attributes which we will use into our rails application and that are., TWILIO_AUTH_TOKEN, TWILIO_ACCOUNT_SID, TWILIO_NUMBER.


Create a simple Rails application using “rails new ” .

STEP 3. gem install twilio-ruby

STEP 4. For the use of SMS service create a controller “Messaging_using_twilio”.

STEP 5. Create a method send_sms into the controller as well as we have to create a view which show only two fields, that are., Message text box and Send button.

STEP 6. Into the send_sms method we need to set three parameters which are we got from twilio account for the service use, that are., twilio_account_sid, twilio_auth_token, twilio_number.

STEP 7. Just below the parameters initialization we will create rest object of the twilio or instantiate Twilio::REST::Client To access Twilio REST resources. The Twilio::REST::Client needs your Twilio credentials(twilio_account_sid, twilio_auth_token, twilio_number). It will return twilio REST resources.

STEP 8. Then just after that we can call the method messages.create() which require :from, :to and :body parameters. The :from is our twilio contact number, :to is our registered contact number (or any contact number if :from number is a paid/ purchased) and :body is nothing but our string message.

STEP 9. The twilio-ruby library will throw a Twilio::REST::RequestError. 400-level errors are normal during API operation (“Invalid number”, “Cannot deliver SMS to that number”, for example) and should be handled appropriately. Through out this way you can easily implement sms service using twilio trial account.


def send_sms


ENV['TWILIO_ACCOUNT_SID'] = "AC48df98e647aeaasdasAASD232bbc26863"

ENV['TWILIO_AUTH_TOKEN'] = "5819a96aed8298f232130f212137b5"

ENV['TWILIO_NUMBER'] = "+11159878489"





response = client.messages.create(


to: params[:phone_no],

body: "Welcome to Twilio SMS service.")

render json: {:response => response}, status: :ok

rescue Twilio::REST::RequestError => e

render json: {:errmsg => e.message}, status: :ok



In the current technologically sound world more and more are opting for web applications for taking their business to a new lateral. In the past few years, Canvas has evolved as one of the most popular learning management system (LMS) and is successfully adopted by many educational and corporate institutions. However, people have restrained there thinking to the fact that canvas can only be used as a Learning Management System. The fact is that Canvas is not limited to only LMS; instead, it is beyond that. Canvas can be effectively used for other domains as well; one of the most innovative ways of using canvas is for conducting Virtual expos.

Features in canvas can be proficiently used for commencing virtual Exhibitions, such as:

Registration of User Types: In any sort of exhibition, different group of people or companies set up their booths for displaying their product and services. For establishing a virtual exhibition there are both visitors and organizers. As whole of the process is done through online medium, hence, canvas provides different users different registration type. This helps is proper bifurcation of users.

Restrictions of accessibility as per the user type: With Canvas, one can create different types of users and based on their role can also define accessibility criteria. For examples: admin can have access to all the functionalities of the application, booth owners will have their own set of accessibility and so the visitors. This will maintain proper flow and confidentiality of data.

Allocation of number of Expos and Booths as per the subscription Plan: Canvas also offer monthly, quarterly, half yearly or annual subscription plan for allocating defined number of expos or booths. This feature helps in keeping proper records of past as well as future expos.

Creation of Expos: Canvas acts as a medium for organizing different types of events. As everything is virtual, hence, the booths that are induced in the expos are also virtual that can be created using canvas.

Creation of Booths: Expos are incomplete without booths; this is so because booths signify the display of products and services in expos. Like expos, booths can also be created from canvas.

Video Upload: This is one of the most interesting features in Canvas, one can upload videos of past expos for giving the visitors can have an overview of how the expos are held. This gives them a sense of confidence. In addition, one can also create dummy videos of how they are planning for the upcoming expos.

Audio visualizers renders music beautifully by visual effects it is a feature found in digital media players it displays animated images synchronized with a piece of deity. If you break the term "audio visualizer" in two parts you get "Audio" and "visualizer", to visualize something is to form a mental image of it, so the audio visualizer converts an audio file into visual effects. Visual effects when combined and synced with music gives listeners a visual delicacy and leisure. We have created a visualizer with web audio API based on HTML5 which is compatible with all the technologies. our visualizer can be customized according to the music genre and personal requirements. This visualizer allows listeners to comment on the songs and express their opinions, their comments can seen by others while listening the songs, these pop on the digital visualizer. Comments can be filtered, we enforce a standard common decency and civility here, aggressiveness, personal attacks and bigotry is prohibited and can be reported.

The graphic visualizations of music is a great source of inspiration for the info-graphic designers. The potential music visualization has for an open mind is tremendous. The combinations of both auditory and the visual effect is often ignored, but the audio visualizers can add a real wow!! factor to your music website. Adding the visualizer gives you impeccable user interface and attraction. Visualizers can either be 3D or 2D.

Music distribution websites design and display their own audio visualizer so that their users can feats their eyes on something while listening music. The essential features of the visualizers that it must have are contrast, clarity improved loud list and an attractive but not too much flamboyant background. The visualizer should also be completely synced with the beats and rhythm of the piece of music. Adding real-time Music visualizer gives your music distribution website more lifelike experience.

Software development is something all types of companies around the world are having to adopt. How they go about purchasing a custom software is a key to their success. There are two choices a company has when it comes to custom software.

1) Waterfall methodology.

2) Agile methodology.

Waterfall methodology is older than Agile methodology is basically a linear model of software design. Waterfall employs sequential codes and design process. In contrast agile proposes an iterative approach to software design. Agile methodology was born after the waterfall model in response to the shortcomings of the waterfall model.

The present situation of the software development market is inconsistent and unstable. Nowadays everyone seems to sell software development services, price ranges significantly, the companies are young and quotes are rarely transparent, etc. In order to sustain in competitive and inconsistent environment one should adopt an agile methodology. There are several ways agile methodology can help software development companies respond to the dynamic conditions of the market.

Transparency and pricing :

Agile contracts offer transparency: The Standard agile contract defines resource types, and resource dedication.

For example:

1) Project manager 50% dedication

2) .net developer 25% dedication

3) Senior .net developer 25% dedication

Clients actively participate in requirement definition and operating cost of the development team. Everything is discussed out in the open team. Time and cost related with every software functionality discussed openly with the development team.

Many lawyers make the mistake of overlooking the fact that they have to deal with a pile of documents every day, this makes their work more tedious.. We have created a web application called FCD for lawyers to solve this problem, which is easy to use and offers great service delivery for lawyers. It will reduce the time spent on phone calls, providing updates and confirming appointments. It will also save time of lawyer's secretary, scheduler, filing clerk, bookkeeper and organized rolled into one. This app is designed to meet every busy lawyers file and case management requirement even when he/she is on the go. Busy clients who are on the go can stay in loop with instant updates, reducing the need for them to contact you.

Law firms are using FCD to increase client satisfaction and internal productivity. FCD helps in Increasing the reach of marketing and the legal insights. To engage more efficiently with clients and collect feedback. It Enables assistants and interns to work and learn simultaneously also helps to increase project management capabilities. It's truly a revolutionary way to help law firms improve client communication while gaining a competitive advantage. Given law firms are faced with unprecedented competition, FCD presents amazing opportunity to embrace innovation ahead of the curve. The great news is any firm can get started today.

The benefit of innovating via our technology are countless

  • Manage and keeps clients up to date with the progress of their client.
  • Reduce the need for constant phone calls, emails and letters.
  • helps to manage a case update
  • Maintain case and update case notes at anytime from anywhere.
  • Creating appointments with your clients is just a click away
  • follow up cases with reminder alarm

One of the greatest benefits of FCD app for lawyers is the flexibility, lawyers have access to their client's case and their information whenever and wherever they are. Taking your practice with you was next to impossible before the introduction of FCD but now it lets lawyers take advantage of the time they spend commuting. Waiting in court or travelling? You can leave that briefcase at the office you are not dependent or limited to, your library or computer you will never need to sync information with your office assistants and you get to bill on the go! Now its possible to keep your client happy 24/7 they do not have to wait for information from your end. You can send secure emails to your clients and solve their queries on the spot real time.

Stock Projection Application basically used for Stock Markets in which shares of publicly held companies are issued and traded either through exchanges or over the counter markets . Also known as the equity markets, the stock market is one of the most vital components of a free-market economy, as it provides companies with access to capital in exchange for giving investors a slice of ownership in the company.

Function and Purpose of Stock Market

The stock market is one of the most important ways for companies to raise money, along with debt markets which are generally more imposing but do not trade publicly. This allows businesses to be publicly traded, and raise additional financial capital for expansion by selling shares of ownership of the company in a public market. The liquidity that an exchange affords the investors enables their holders to quickly and easily sell securities. This is an attractive feature of investing in stocks, compared to other less liquid investments such as property and other immoveable assets. Some companies actively increase liquidity by trading in their own shares.

About Stock Projection Application

This application fetches the recent data of all together 2161 companies from Yahoo Finance and after some calculation reffrenced with past 7 days , it will display conditions of “Buy” (i.e whether the company has profit or loss). All company records from last 10 years are saved in database and by continously monitoring these values, next day prediction of condtions are set. One important property of theses application is it shows result of companies in json format or in table form. So user can save particular company data in document for there use.

Firstly, these Application fetches updated previous close price from Yahoo Finance and starts calculating Terms used for calculating conditions. It calculates the following terms to set condition of “Win” or “Loose”

Buy Price – mean(price_array_yearly)- where price_array_yearly is array of last one year prices.

Sell Price - Buy Price + target_increase- where target_increase = percentage change in Average Price with taking 5( user defined) at numerator

Average Price(Past 01Year) – Calculate mean of last 1 year prices.

Standard Deviation Yearly- Calculate standard deviation of prices.

Average Monthly Standard Deviation 3 years- Calculate average of last 3 years standard deviations.

Lifetime Strike Rate- It will monitor 4725 records of trend and check whether the trend >10 or =10, and decides the conditions for “win” or “loose”.

Yearly Strike Rate- It will monitor 365 records of trend and check whether the trend >10 or =10, and decides the conditions for “win” or “loose”.

Gain Momentum In Percentage - Calculate percentage of Average price with 5 (user defined) at numerator.

Target In Percentage - Calculate percentage of Average price with 10 (user defined) at numerator.

Conditions – display result of win as “Buy” or loose as blank.


This application is very useful for people who are investing in stock market and it help people to understand and predict stocks, find the possibility of win or loose by monitoring history of companies prices.

With the Kaltura Canvas Video App, teachers, students, and staff easily view, record, manage, edit, transcode, and deliver high-quality video that is visible on any device, at any time. You'll be able to currently take teaching and learning to a full new level with interactive video tools seting with LMS. This app permits you to look at, upload, publish and share videos directly from inside your LMS. This interprets into time and cash saved for your establishment, and a lot of encouraging, interactive learning expertise for college students as well as for colleges.

With Kaltura, you can

  • Create videos with webcams, or Kaltura’s optional CaptureSpace video capture solution
  • Upload existing media from your laptop, college video platforms and also social media
  • Add searchable captions and data for exaggerated discoverability
  • Manage videos by personal library, course galleries or shared repository
  • Edit with in-system tools like clipping, chaptering and managing thumbnails
  • Publish to a course gallery, as a part of a check or assignment in a blog or more


  • Increase collaboration, engagement, community and learning outcomes
  • Ensure media security victimization Canvas permission system
  • Take advantage of Kaltura's tier one hosting and CDN to deliver a high-quality expertise while not overloading your LMS
  • Lower prices and work by sanctionative students and college to transfer and manage videos within the LMS while not requiring facilitate from a central media team

Kaltura Integration Step through External LTI Tools In Canvas :

For Kaltura Configuration in LMS, You will need an account either at or with a self-hosted instance of Kaltura.

  • From your course home page in Canvas click on Settings.
  • Click on the Apps tab and then View App Configurations.
  • Click on Add New App(the button may just say Add App in some versions of Canvas).
  • A pop form will appear, underConfiguration Type Select “Paste XML”.
  • Name can be set to any non-blank value. You will need to contact your Kaltura account administrative to get Kaltura account Partner Id as "Consumer Key", account administrator secret as “Shared Secret” and Paste the content of MyMedia.xml provided to you by your Kaltura representative.
  • Checked the "Add Kaltura to Rich-Text Editor" button so it will appear in Rich-Text Editor
  • Click Submit. The My Media tool will be listed in the list of external tools and a new navigation menu item will be added to the course menu.

The Mockworth Clock Game is concentration game based on Mockworth Clock. The Game has a black background circular Dial with 24 "+" marks representing 24 slots like clock and red dot jumping over these slots . The red dots moves in short jumps like the second hand of an analog clock, approximately every second. At infrequent and irregular intervals, the red dots makes a double jump, e.g. 3 times in 1 complete loop. Basically the game is to detect when the double jumps occur by pressing space-bar. Typically, Mackworth's participants would play these game for pre-defined number of loops.

The Clock is an experimental device used in the field of experimental psychology to study the effects of long term vigilance on the detection of signals. It was originally created by Norman Mackworth as an experimental simulation of long term monitoring by radar operators in the British Air Force during World War II.


In Mockworth clock game, black circular dial is designed with the help of HTML and CSS, 24 “+” signs are designed using images and it is placed in circle with css property transform: rotate(x deg) translate(x px) rotate(-x deg) where x and y is user defined.

For example:

red dot pointing at 12 o'clock

.deg270 {

transform: rotate(270deg) translate(17em) rotate(-270deg);


Red dot movement is achieved with the help of javascript animate() function and opacity css property. And to make red dot movement in loop, we use javascript recursive setTimeout(function()) function.

For example:

To blink red dot at some interval of time.

setTimeout(function() {


{opacity: 1},{

duration: 400,complete: function ()


$(this).css({opacity: 0}); <.p>




Skipping of red dot is done by Math.round(Math.random()) function.

When red dot skips, participant need to press space-bar and hit counts. These is achieved by using keypress() function and result is displayed in score board.

For example:

For counting space-bar pressed.


var keycode = (event.keyCode ? event.keyCode : event.which);

if(keycode == '32' ){



document.getElementById(' id_name ').innerHTML = SCORE;


At the end of game, final result is displayed, which is using parseInt() and text() function.

Game Procedures

  • A circle, with 24 equally spaced "slots" (as represented by the empty space between two "+" marks), is presented on the computer screen.
  • The Subject can put n number of loops as per interest in input box and starts the game.
  • A red dot starts from the 12'o clock position and flashes in turn in each "slot".
  • The dot stays visible for 1 sec and so there is an interval of 1 sec between each flash.
  • At some postion red dot skip anomaly .
  • Total number skip is random in complete one loop.
  • The subject identifies this event by hitting the space bar (or other user-definable key).
  • The entire game lasts up to a pre-defined number of loop.
  • After the game over result is diplayed on Score Board in percentage.

Canvas is a cloud-based Learning Management System that makes teaching and learning easier. Many tools are integrated in Canvas, so it can be used online, on mobile and on tablet. One of the interesting tool is Blackboard Collaborate.

Blackboard Collaborate web conferencing is an LTI-compliant LMS, such as Canvas, BrainHoney and Sakai. Instructors create and manage Blackboard Collaborate sessions and recordings from inside the LMS of their choice.

Blackboard Collaborate perfectly complements Blackboard Learn creating a comprehensive digital learning environment. For students and teachers, synchronous learning is a rich part of their learning experience and is seamlessly available through Blackboard Learn and Bb Student.

For blackboard integration in LMS, Contact Blackboard for account registration and to retrieve a key, secret and URL.

Instruction to Set-up in Canvas LMS

These instructions describing how to setup Blackboard Collaborate LTI tool in your Canvas Course, where LTI stands for Learning Tools Interoperability.

  • From your course home page in Canvas click on Settings.
  • Click on the Apps tab and then View App Configurations.
  • Click on Add New App(the button may just say Add App in some versions of Canvas).
  • A pop form will appear, select Configuration Type as By URL , the Name can be set to any non-blank value.
  • You will need to contact your Blackboard account administrative to get the "Launch URL", "Shared Secret" and "Consumer Key". Checked the "Show in Course Navigation" button so it will appear in Course Navigation.
  • Click Submit.

Now you will able to see Blackboard Collaborate in Course Navigation and you can create sessions and recordings.

Why Use Pluck in Ruby on Rails:

Pluck in ROR is used to get array of particular attribute based on particular condition from database. If you only require a few attributes from a table, rather than instantiating a collection of models and then running a .map over them to get the data you need, it’s much more efficient to use .pluck to pull back only the attributes you need as an array.

The benefits of using pluck are: better SQL performance and less time and memory spent in Ruby on Rails.

Standard format of using pluck method is


Using Pluck:

  1. You can select one or more attributes without loading a bunch of records just to grab the attributes you want.
  2. You will get array of values of attribute which we pass to it.
  3. Pluck also replace select and map while querying.
  4. You can avoid extra loops to get ids from the collection of ActiveRecord while using the pluck method.
  5. Pluck is useful method in ruby to improving performance of your app.
  6. Pluck returns the array and breaks the ActiveRecord query method chain so becareful when you want to query on the result.

Pluck can be use in various ways to improve our code quality as well as speed of app, some of them are shown below

When you want array of ids from a table you can use pluck

eg. Category.pluck(:id)

# => [1, 2, 3]

You can use pluck to get array of multiple attributes from table

eg. Service.pluck(:id, :business_id)

# => [[1, 3], [2, 5], [3, 2]]

If you want unique values of attribute in array you can use pluck as given below

eg. Category.uniq.pluck(:name)

# => ['home', 'apartment', 'hotel']

You can use pluck in query itself

eg. categories = Category.where(name: “home”)

Service.where(category_id: categories.pluck(:id))

# => [1, 2, 3, 4, 5]

Bitcoins are a very common terminology now. To let you know further about Bitcoin it’s a very popular cryptocurrency. As it’s a crypto currency it’s a virtual money and cannot be exchanged physically.

There are ways of using plastic money and most of the merchants use the way of getting the payment online. But while including this third party integration the merchant has to pay this third party and there is approximately 3% the merchant has to pay for every transaction made.

The way PayPal, Braintree, Ccavenue, and other payment gateway work the same way Bitcoin payment gateway can be integrated in a merchant's e-commerce site.Bitcoins are virtual currency and can be saved in virtual wallets. The merchant’s wallet will be integration in his application and the customer can make the payment through bitcoins which Will be transferred to the merchants wallet.

These bitcoins accumulated in merchant’s account can be exchanged to the local currency as and when required. Bitcoin payment gateway integration is a very easy to be implemented payment gateway and has a easy understandable documentations for the same.

What is RESTful API

A RESTful API is an application program interface (API) that uses HTTP requests to GET, PUT, POST and DELETE data. Representational state transfer (REST), which is used by browsers, can be thought of as the language of the Internet.

Steps in creating RESTful API: Step 1: Creating an API

While creating an API, the controller is kept in a separate folder named api inside app/controller of the ROR application.

Step 2: Creating a Versioning Folder

Once an api folder is created, we create a versioning folder under api folder. This versioning folder is created according to the API requirement. An existing API should never be modified, except for critical bugfixes. Rather than changing existing API we create another version of that API.

For ex., app/controller/api/v1 or app/controller/api/v2

Step 3: Creating a Controller File

Create a controller file inside the api folder like home_controller.rb

Step 4: Creating Controller Class

Inside the controller file we need to create the controller class. This controller class will contain the method which is used while calling an API. Basically, the method inside the controller is nothing but a business logic of the requirment of an API. So, this method is defined to run as per the requirement of an API. This method will return the JSON format data. For that we need to render the result into JSON format.

The above steps deals with the controller /api folder. Now, if someone wants to call a particular api method, for that we need to define in routes.

The routes is used for calling an API methods defined inside the config/ routes.rb file of the ROR application.

Route Example :

namespace :api do

resources :home, defaults: { format: 'json' } do

collection do

get 'business_details&:category_service&:city', to:'home#business_details'




So, our calling URL for above step should be http://localhost:3000/api/home/business_details&Food andRestaurants&USA

And result should be

{“name”:“MacDonalds”, “address”:“New York, USA”}

In the early days artists use to record songs and distribute on different DSP's which help them to make money. But, in an era of internet, distribution of songs on different DSPs is not sufficient for an Artist.. Social media presents an interesting opportunity. As music fans, most of us turn to Twitter or Facebook to keep updated about our favorite bands, whilst new tracks or videos will 99% of the time get their launch on social channels. This gives a complete popularity to the artist. Artist needs promotion on Social media along with distribution and royalty processing so that he earns more revenue.

There are many social media platforms for promoting music but facebook is one of the fastest medias to Promote Music and Generate Revenues

In order to increase your popularity on facebook you should have all of the following in place before running your ads.

1. Create an artist page first

2. Make your presence on facebook as an active member by posting on a daily basis

3. Online music sale should be listed

4.Content like videos, pictures and blog posts for your fans to interact with and comment on.

Benefits of Facebook Ads:

Facebook ads allows to learn about your audience, gain fans, and sell music by putting your ad in front of a very targeted group of Facebook users.

Facebook Ads does the following:

  • It will Drive traffic on your Facebook page
  • Get Likes for Your Facebook page
  • Advertise Your Facebook Event
  • Advertise any offer that links to a website outside of Facebook
  • Target specific Facebook users depends upon likes, age, region etc.

Targeting fans who already ‘Like’ you on Facebook

It’s common to spend a lot of time targeting new fans and forget to target the people that have already shown interest in your music. Most likely you have far more people that Like your Facebook page than have actually purchased your music. Facebook allows you to specifically target people who like your page, so why not make special offers for the people that are most likely to buy your music?

Cryptex Technologies will help you in the following Key elements of an effective ad

  • Focus on a call to action: A “call to action” is a line that basically says, “do this now.
  • Compelling Text: Since there is not too much space for text in facebook ads, hence the ad should be crisp and effective. Cryptex Technologies creates facebook ads which perform best.
  • A picture is worth a 1,000 clicks: Cryptex Technologies follows marketing research guidelines to upload images which will be clicked more often.

Elasticsearch provides a powerful, RESTful HTTP interface for indexing and querying data, built on top of the Apache Lucene library. it provides scalable, efficient, and robust search, with UTF-8 support. It’s a powerful tool for indexing and querying massive amounts of structured data.

Why Chewy?

Despite Elasticsearch’s scalability and efficiency, integration it with Rails didn’t end up to be quite as straightforward as anticipated. And thus, the Chewy gem was born.

A few notably noteworthy options of Chewy include:

1. Each index is discernible by all the connected models:

Most indexed models square measure associated with one another. And generally, it’s necessary to denormalize this connected information and bind it to a similar object (e.g., if you wish to index associate degree array of tags beside their associated article). Chewy permits you to specify associate degree updatable index for each model, thus corresponding articles are going to be re-indexed whenever a relevant tag is updated.

2. Index categories square measure freelance from ORM/ODM models:

With this improvement, implementing cross-model auto-completion, as an example, is far easier. you'll simply outline associate degree index and work with it in object-oriented fashion. not like alternative shoppers, the Chewy gem removes the requirement to manually implement index categories, information import callbacks, and alternative elements.

3. Bulk import is everywhere:

Chewy utilizes the majority Elasticsearch API for full re-indexing and index updates. It additionally utilizes the conception of atomic updates, aggregation modified objects among associate degree atomic block and change all of them right away.

4. Chewy provides associate degree AR-style question DSL.

By being chainable, mergable, and lazy, this improvement permits queries to be created in a very additional economical manner.

In the prevailing technologically sound world paying due consideration on the quality of goods and services are very crucial for ensuring customer satisfaction. In addition, quality also maintains customer expectations, reputation, meeting standards and above all costs. Automated Code Quality Testing is a very popular concept in the Information Technology industry. Earlier, the concept of manual code quality testing was very popular but there were some limitations associated with the same, such as:

  • Manual code review is a slow process. On an average it covers only 100 to 200 lines per hour.
  • There were also various security related flaws in the testing process.
  • At a time human memory can keep seven items in memory that are helpful in performing the testing process but automated tools can keep hundreds or even thousands of criteria. This indeed does not eliminate the need of human reviewer, as they are the one can produce both false positive as well as false negative testing reports.

Moving ahead with the automated code reviewing tools, there are various tools that are available in the market that claims to offer efficient code quality testing. List of popular tools comprise of TraceRoute, Rack-Mini-Profiler, Brakeman, DeadWeight, CodeClimate, RubyCritic, Rails Best Practices and more.

Most of the tools that are mentioned above are paid and some does not ensure complete accuracy. However, Rails Best Practices is the one that helps in ensuring accurate result. Ruby on Rails is one of the niche technologies; there are very limited companies who work flawlessly on this technology.

Cryptex Technologies is one of the most renowned companies that work on ROR and also religiously follow Rails Best Practices. The very reason why Cryptex Technologies have a stable clientele is because of the code quality they maintain for creating web and mobile applications.

A productive framework has changed the rules of web development.

Ruby on Rails is a framework innovation: it contains all the ingredients necessary to quickly build a web application performance. It is a tool designed in the spirit of agile development to deliver productivity and flexibility for development teams.

Based on the Ruby development language, it has revolutionized the world of web development through its pragmatic approach.

Ruby on Rails' philosophy is summarized by two principles:

• "Never again" and it saves time, concentration and reduces code size.

• "Convention over configuration": it is better to use the conventions that wasting time to configure.

The advantages of Ruby on Rails:

1 - Develop faster

• Ruby on Rails is a compact language provided a clear and concise syntax: it produces less code than its competitors.

• Less code to produce, so it's less time to code, less error-prone, less code to maintain.

• Integrated tools for automating repetitive tasks: creating a form, management of database error handling...

• Developments are simpler because the code is lightweight and easily readable, the closest possible human syntax.

2 - Gain productivity

Everything has been designed to minimize the development part of a project and maximize the part creativity and originality of the project. Developers focus on design rather than reinventing the wheel with each new project. They are gaining more productivity by eliminating repetitive tasks and find the pleasure of coding.

3 - Check the code quality

Ruby on Rails has a test framework built checking code quality. With each new code change, it is verified and validated. Errors are reported as and when the programming and can be quickly corrected. This ensures high code quality.

4 - Create interactive interfaces

The technologies needed to program rich interface are integrated and activated on demand. With integrated javascript framework is easy to activate features drag & drop, apparitions progressive elements, zoom.

5 - Structuring the development

Ruby on Rails is based on the design template "Model-View-Controller" that separates the application from the data, presentation and treatment. This requires the programmer to better structure the application and code in a logical and coherent. This encourages a higher level of abstraction in programming the application, thanks to high-level functions to focus on features rather than on the details.

Ruby on Rails developers working in varying regions of India have taken steps to write web applications in Ruby programming language that helps in communication between stakeholders, and helps to maintain high code quality with a very good standard. It is commonly termed as ROR and is an object oriented program language. It is only because of Ruby on Rails the web application has been created.

Benefits and Advantages of Ruby on Rails

ROR has several web services that work effortlessly by building powerful and well-designed applications. It is very useful for developing data base, supported with web application

  • Using simple methods and less code you can very well develop the applications
  • It makes easy and quick web solutions development and flexible with different types of web servers and databases for fast implementation
  • Provides smooth compliances with various databases and allow the ROR programmers to create the latest user friendly and advanced application
  • The ROR framework helps in the speed of development with culture and standard. It is very easy to understand with the help of this programmer
  • The development rate possessed by Ruby on Rails developers in India has been increased by about 40 % as compared to other programming language or framework
  • The most important parts of the culture are a social ROR which enables to help others to solve any issue. You can also share with the community.

Tools Developed by ROR Team in India

Ruby on Rail Developers in India has come up with several nice development tools, which include:

You can now have the opportunity to enjoy the advantages of Ruby on Rail development in India with the support of rate and cost.

  • Testing: The Company with the help of quality control department helps to test projects Caching: important factor to develop major internet project and ROR already has regular basic configuration means of caching data
  • Routing: ROR has the flexibility to change and configure routing, typing addresses, main sections names and also in a position to quickly change the address without disturbing the whole project address.
  • Validating: places all the validation input data perfectly. Users can verify mail id address, password and login.
  • Localizing: whenever the user wants to put another language while doing the project then he can open a parallel project which is a copy of it and translate it.
  • Database structure:
  • Safety: Provides safety measures
  • Deployments: tools are used in the deployment process

With the scenario of internet business and online promotion, large numbers of artists and labels have chosen to upload their songs and musical contents on digital media websites rather than following of traditional selling methods. On the other side, reputable digital distribution platforms have started offering individual singers, labels and other artists with advanced and safest modes to make money by selling their uploaded contents via internet. Especially, Cryptex Technologies offer a special facility of Royalty processing to benefit labels and to obtain success in the sector of digital media distribution. Significance of this technique will include:

Processing of Payments in Hassle-Free Way

Innovative Royalty processing software collects suitable royalty amount from varying music and media sources in DSP format and then, according to required format of clients, it processes the earned amount to respective clients, labels and individual artists without any difficulty and within less possible duration.

Aims at Boosting Efficiency and Accuracy Levels

Usage of advanced web-based solution for digital royalties boosts accuracy and efficiency and in turn, gives individuals with complete control on the workflow of revenue recognition and royalty processing. In fact, our reputable digital distribution medium lets clients to recognize revenue generated from different media sources, like ad-supported, subscription based and transnational sources.

Ongoing Support is Possible

Our sophisticated software solution and qualified technicians let labels and artists to receive ongoing support for their royalty processing services. For this, we cleanse and validate each data comes in your system.

Assures Creating Long-Term Success

Based on our experience in dealing with digital media platforms, we opt to follow key steps aimed at sound management of your royalty account processes, which would foster drastic growth, creates big success in the sector and simultaneously, maintain stability with various clients.

At some purpose in each Rails application's life, you'll have to perform some reasonably maintenance or code update that may need taking your application offline for a short span of time. There square measure strategies to attain zero-downtime deployments, however typically it's simply easier to require your application offline for five minutes throughout a preparation. If you recognize that no-one is writing information into the info, then you do not need to worry regarding synchronizing information or merging info backups back in once your deployment is finished. It simply makes life less complicated in cases once a number of minutes of time period is appropriate.

But, throughout this "dark period" once your application is offline, you must still offer your users some notice of what's happening, and after they will expect the upkeep amount to finish.

Quick-Start with Turnout

The turnout gem makes it straightforward to quickly place up a friendly maintenance page for your users, and block access to all or any routes at identical time (to forestall writes to your database).

The main edges are:

  • Easy installation
  • Rake commands to show maintenance mode on and off
  • Easily offer a reason for every time period while not writing the upkeep.html file
  • Allow sure information sciences or IP ranges to bypass the upkeep page
  • Allow sure methods to be accessible throughout maintenance
  • Easily override the default maintenance.html file together with your own


In your Gemfile add:

gem "turnout"

then run

bundle install


rake maintenance:start reason="We're updating our site, please check back in 5 minutes"

In the recent few years, Ruby on Rails has become one of the productive frameworks to bring drastic revolutions in the rules of web application development. In fact, ROR development now works as a framework innovation and contains each necessary ingredients or resources that will help in creation of a high performance of web application.

Especially, Ruby on Rails developed by one of the reputable companies as Cryptex Technologies serves as an innovative tool aims at agile development and assures delivery of highest possible flexibility and productivity for various web development teams. Major contribution given by the technician team of Cryptex Technology to boost the productivity of website developers and application developers will include

Database Access Library

ROR has incorporated active record or database access library to allow simplification in the actual process related to handling of data contained in databases. Furthermore, this library maps different tables automatically into varying classes and in the same way, rows into different objects.

Allows for Fast Development Process

According to experienced web app developers, Ruby on Rails is a type of compact language that provides concise and clear syntax or produces relatively less code as compared to competitors available in the market. Less code obviously requires less time in coding job and less error prone towards less maintenance.

Helps Boost in Productivity

RORs available for web application development intends to reduce development job associated with any project and in turn, enhances originality and creativity. Hence, developers can easily focus on their designs instead of reinventing wheels with new projects.

Customization Process is Possible

Last, but not the least, Ruby on Rails developed by Cryptex Technologies allows users to develop wide range of search-engine friendly and personalized types of URLs.

If you're new to programming in Ruby, here are the 3 tools you must know.


The Ruby debugging tool can be found in the library file debug.rb. This tool will let you run your program one instruction at a time, with pauses in between. At every pause you can examine the values or variables of your code, locate your position in a series of nested commands and/or resume execution. You can also tell the debugger when to stop, more commonly known as breakpoints.

Using a debugger varies from programmer to programmer. Just because a debugging facility is available for Ruby, it doesn't mean that a novice programmer should quickly adapt himself to using it at once. There are programmers who are comfortable using a debugger, some aren't. It's a matter of preference but at any rate, it's nice to know that there's a tool available for Ruby.


Eventually, when you start writing longer programs, you'll want to measure how much resources, especially time, is used up by parts of your program or as a whole. This is called profiling.

You can do profiling using the command $ ruby -r profile c2fi.rb Profiling identifies the areas in your program that are using up lots of the system resources. Having identified these areas, you need to re-code your program to make it run efficiently.


Probably the coolest tool of them all, Ruby provides you with a program called ERb (Embedded Ruby), which allows you to put Ruby code inside an HTML file. You get to embed Ruby inside non-Ruby, and interprets the whole thing as program input.

Ruby on Rails is becoming a popular choice for many programmers in India. Cryptex Technologies is having an experts team of Ruby on Rails Developers in india and delivers a bug free web app as well as mobile app.

The music industry is growing by the day. Nowadays, music is available on digital channels. If you have iTunes installed in your mobile phones then you can listen to the music of your choice. A significant percentage of the global music industry revenue is obtained from digital channels. Out of them, a certain percentage comes from streaming services that are subscription based.

If independent artists are contemplating of placing their music in digital stores then it can prove to be difficult, sometimes. It is because many stores do not accept submissions from independent artists. They focus on selling their music through a network of trusted companies. The concept of distributor is important thus. The distributors are entrusted with the task of getting the music to the stores. In the stores, nowadays, music is sold in compact discs, DVDs. In this context, it is relevant to state that there has been a sharp reduction in physical sales.

Correspondingly, there has been an enhancement in digital revenues. Distributors that earlier focussed on physical products now offering distribution digitally. Considering all this, it makes sense that developing own distribution is more profitable. For instance, if you consider about revenues obtained in 2015, you will find about 20 billion i.e. about 5 billion higher as compared to the data obtained during the last year. In addition, experienced people of reputed music distribution application, like for instance Cryptex Group has predicted that the figure will reach at extremely high during the upcoming 2020.

When talking about digital music, there is a broad variety of online stores and services, from where the distributors supply music. The stores deal with the distributors for proper delivery of the content. The different processes in the stores are run automatically. Having to handle a process manually is time consuming.

Because of this, distributors have developed software to automate the processes. In addition, if labels and artists opt to sell their music contents to online distributors, they may have to give some percentage as share say 15 percent to distribution for selling of music collections. In this situation, far better option would be to develop own software and thereby, save few bucks.

In contemporary times, the digital music distribution is quite popular. As already discussed, it is quite convenient and very much profitable.

The framework of Ruby on Rails is a very powerful tool within the development of web applications. it's several integral options like object-relation plotter and intelligent routing that accelerate web applications development.

Rails is specifically designed to own a simple extension with use of Ruby gems. an enormous system of Ruby gems has been created as a result of it. These gems will accelerate development method and extend application method by reducing time concerned to figure on common practicality development.


Devise is the most gem on Rails. This gem provides authentication resolution that's convenience to use for Rails applications permitting registration, login, account locks, forget password, and different options associated with account.


There is associate importance of knowing the distinction between authorization and authentication. Devise is that the one serving to within the authentication and verification of users whereas authorization is assures that users area unit allowed to perform any action or have access to any resource. Oundit is incharge of whole method and provides straightforward ways in which of describing authorization systems simply by the utilization of Ruby classes.


Template systems area unit everyplace. Rails uses the model system of eRuby by default however it’s one thing that users usually opt to replace. Slim is taken into account as a standard replacement as a result of it's permitting users to keep up straightforward reading templates through its syntax whereas it maintains fast compilation times.


Draper is that the gem that enables user to make decorators around their models. This gem makes views cleaner thus users area unit prevented to jot down helpers. instead of line of work helper on the models procedural, users outline the decorator wrapping the first model and giving the list of extended attributes and ways to things.


Many application parts area unit typically re-used. Basically, partials area unit within the use of those behavior however users should take hold on partial calls and every one partial calls having consistent behavior. Cells enable users to require a part of controllers and encapsulate those in their own controller. By this, you'll be able to mark your own code cleaner and avoid helpers.


URL resources area unit usually known by personal key, that is additionally the info ID. however this might result to un-optimized URLs of websites that aren’t that easy. FriendlyId will instantly rework URLs to a friendlier, straightforward to hit the books URLs thus there'll be no code changes on the appliance.

Simple Form

Forms are the core of web application. User interactions are sometimes done exploitation web forms. Simple form simplifies straightforward and repetitive tasks. It implements simple to use DSL in creating forms. Users pay lesser time on writing HTML for forms and have longer for the guts of the application’s business logic.


It’s additionally exhausting to contend with file attachments as a result of they involve relevant work and time to implement them in an exceedingly secure manner. Paperclip takes charge of this method on Rails applications and extends time for thumbnails.


This gem is the most popular having 5M downloads. This enables users to paginate from ActiveRecord relations to simple arrays using simple APIs fully agnistic to any template or ORM engine.


This gem is that the most well liked in backgrounding tools. it's has simple API and scale even better than some background processors.

Making use of these gems Cryptex Technologies ROR developers in India deliver an excellent bug free applications.

Every developer needs programming for net applications to stay as straightforward because it will get. Most of them need to figure with a framework that's straightforward and simple to use. Similarly, each business needs a technology that helps it to save time. This is often wherever Ruby on Rails comes into image as it is a standard web application development framework extensively used in IT industry. The framework is incredibly useful to developers because it doesn't force them to jot down lines of codes for adding options and functionalities in websites and applications of clients' comes.

More so, developers realize this framework not solely very simple to figure with however additionally fun for development functions. The framework is hot at the instant because it comes packed with AN array of useful options to feature tremendous price to websites and on-line applications. For net applications, Ruby on Rails is taken into account simply good because it fetches a operating example in a very super gait. It additionally provides developers the convenience of checking the practicability of net comes in a very hassle-free and simple manner. the most effective half, it permits fixing of cracks within the development cycle early - one thing not out there with different frameworks.


Furthermore, businesses realize Ruby on Rails quite favorable because it helps them save lots of cash with their net comes. It's 100 percent free and this makes it one amongst most efficient frameworks around for businesses to satisfy their web development goals in a cheap manner. It runs on the open supply Linux and developers face completely no issue in operating with this framework. More so, developers victimization this framework move from the look to actual development stage in a very swift manner and this encompasses a ton to try to to with the straightforward handling that it offers. This is often however an excellent deal of your time is saved with comes.

In addition, the framework is supported by a lively and useful community wherever developers are continually able to troubleshoot issues of any nature and facilitate folks engaged on comes. it is the efforts of community that sees a forceful improvement within the code and this is often however the framework becomes a lot of sturdy and standard for users and businesses alike. More so, comes that use Ruby on Rails ne'er face issues once taken from one developer to a different as secret writing conventions ar followed in building them. Since this framework is straightforward and easy to figure, comes can continually have a viability in future.

Furthermore, Ruby on Rails is one amongst those technologies that facilitate one build their own plug and play apps while not seeking external support. which suggests, future comes are often sustained on the idea of components of existing comes and developers are going to be saved the inconvenience of doing things from the scratch. More so, this framework lets your apps to serve multiple functions in conjunction with being expandable. Quite clearly, the list of options is simply an excessive amount of to ignore and you ought to therefore rent ruby developers to learn from all of them.

Anyone who closely follows the developments within the internet Technology trends can understand that today the most demanded technologies is Ajax and Ruby on Rails. And, nowadays the thrill word is that the customizable on-line message processors. It is an open source and web based message life cycle management system that can be used for software development projects.

This tool provides basic message life cycle management functions that will embrace the regular add, edit, delete, review and different functions. Some of the current functionality include:

1. Content validation that's rule-based to validate the input as per the pre-defined rules. As a result, the inputs that don't benefits the principles won't be saved within the system.

2. Every individual will create modifications and enter comments.

3. It permits you to import or export XML directly into your software system.

4. May be changed simply to best meet your project needs.

5. May be deployed as an online application simply.

This tool has been designed on Ruby on Rails, that may be a sturdy framework for developing the online applications. The Customizable on-line message processor may be extended or custom as per your specific desires. It conjointly provides straightforward thanks to manage the information connected style and helps you to trace the complicated information transactions.

It also can be used for the event of product specific needs like user authentication and different connected applications.

As we tend to enter the Web 3.0 era, there are many other upcoming apps under rapid development, and they will hit the market pretty soon. So, keep an eye on the release of the latest open source projects in the world of web technology.

With the consistent progression in the sector of music and digital technology during the last few decades, mainland CD stores and their popularities in the market decreased continuously, while demand for download of digital music continued to be popular in between worldwide music lovers.

By claiming approximately half of the worldwide music buying audience, digital music distribution serves as a predominant method offered by musical marketing world today. Indeed, the question comes in the mind of people is that how digital music platform helps artists, labels and music lovers belonging to different parts of the world.For this, experts have said

Serves as Platform for Artists and Labels

Digital music mediums have provided an efficient platform for large numbers of talented and skilled labels, who want to explore their music over iTunes and other musical sites.

Offers Royalty Processing Benefits to Users

Online music distribution software offers royalty-processing benefits to their users. This implies that the website collects suitable royalty amount in the suitable DSP format and later on, process it in the format demanded by labels in hassle-free way and even within the mentioned duration.

Provides Data about Demands and Sales

Each label or artist chooses to register with digital music platform would be able to receive necessary updates and reports on demands and latest trends regarding the sales of their music or songs. Last, but not the least, artists opt to join reputable digital music platforms will also be able to avail of load balancing solutions based on their specific requirements.

Therefore, digital music distribution platform has provided wide range of benefits and many applications to labels and music lovers worldwide.

Big companies belonging to different parts of the world have already started trading with Bitcoin crypto currencies. However, now many small business owners and entrepreneurs are stepping forward to include this virtual currency in their own business activities. On 15th of June, a meeting takes place at the Hester Street Fair in New York City’s Lower East Side, where large numbers of artists, collectors and entrepreneurs have joined and planned to host NYC Bitcoin Fair for the year 2015.

Here, individuals associated with trading and business activities will be able to find large numbers of technological enthusiasts, innovative companies dealing with the virtual currency of Bitcoin, meet-ups, traders and more than 30 different small-scale businesspeople selling their top quality of artisan goods and food items for Bitcoin.

Suhyun Pak, who is one of the co-organizers of Hester Fair and Bitcoin Fair’s creator, commented, “Every Sunday, we will hold this fair to motivate online traders until 26th of October. This fair would definitely act as a perfect environment for the utilization of bitcoin. Majority of businesspeople attended the Hester Street Fair possess entrepreneurial feelings and have huge willingness to try innovative things. Even many of the attendees have shown huge excitements to stay at the fore front of new bitcoin trading technology.”

Another update about bitcoin trading highlighted that on West Coast, large numbers of restaurants located in San Francisco have started trading with Bitcoin. In fact, many of them use its old payment system as Bitpay and use it for 1% of the total transaction fee. Especially, one such restaurant of San Francisco had been accepting Bitcoin virtual currency since past few months.

Combining Perl-inspired syntax with features like those of Smalltalk, Ruby is a dynamic, reflective, general purpose object-oriented scripting language. It was developed and designed on February 24, 1993 by Yukihiro "Matz" Matsumoto in Japan. Perl, Smalltalk, Eiffel, Ada, and Lisp are the languages that it is based on.

Including object oriented, functional, reflective, and imperative, multiple programming paradigms are supported by the script. Moreover, it has an automatic memory management and dynamic type system, which makes it analogous to CLU, Perl, Python, Dylan, and Lisp in varying respects.

C was used to write the implementation of the standard 1.8.7, as a single-pass interpreted language. At present, no specification of the language exists, and hence the de facto reference is its original implementation. As of 2008, several of its alternative implementations have arrived including YARV, JRuby, Rubinius, IronRuby, and MacRuby. Each of its alternatives takes a special approach while just-in-time compilation is provided by JRuby and IronRuby. YARV is used by the official 1.9 branch. Version 2.0 which is in development is said to be using this also and is said to be finally superseding the slower MRI of the language.

The concept that gave birth to the script was that there got to be a scripting language that balances functional programming with imperative programming. According to the designer and developer, Yukihiro, a scripting language that was more object-oriented than Python and more powerful than Perl was what he was looking for. And so he ended up creating the script. Yukihiro has stated that he designed the language from programmers' point of view as he believes that systems design should give emphasis to human needs more than computer needs. So, he followed the principles of good user interface design, and as a result it not only enhances a programmer's productivity, but most programmers find working with it a fun, cool thing.

Rumor has it that Ruby follows the principle of least surprise (POLS) - the language behavior that minimizes confusion for experienced users. However, in a May 2005 discussion on the comp.lang.ruby newsgroup, Yukihiro tried to detach the script from POLS. Besides, he has stated that he had not applied the principle of least surprise to the design of the script. In spite of this, the script seems to be believed following POLS among some programmers.

Features of Ruby:

Following are the features of the script:

  • Object-oriented
  • DLL/Shared library dynamic loading on most platforms
  • Six levels of variable scope
  • global
  • class
  • class instance
  • instance
  • local
  • block
  • Exception management
  • Methods can be called without parentheses, making Ruby trendy for putting into operation Domain Specific Languages
  • Automatic garbage assembling
  • Iterators and conclusions
  • Indigenous, Perl-like standard terminology at the language level
  • Operative overfilling
  • Greatly portable
  • Two-way multi-threading on all platforms by means of green threads
  • Introspection, reflection and meta-programming
  • Big standard library
  • Sustains reliance injection
  • Sustains object runtime modification

Bitcoin crypto currency has recently succeeded itself in picking up few of the prominent followers belonging to the technological circles. This digital currency has demonstrated surprisingly high levels of durability in between online traders, leading to the development of curiosity in between top-class websites and search engine giant as Google.

Google Idea and Google Inc Reports

According to the director of Google Ideas Group named Jared Cohen, “It is obvious to each individual that crypto currency as bitcoin is an inevitable one.” Majority of individuals belonging to film, music and technological festival’s attendees have given their support to the statement given by Mr. Cohen. In addition, Eric Schmidt, the Chairperson of Google Inc had aimed to promote new book of Google Group as “New Digital Age.” However, director of Google confirmed that one should never interpret it as endorsement from the search engine giant group.

Wikipedia’s Key Findings about Bitcoin

Jimmy Wales, the co-founder of Wikipedia is now doing experiments with the bitcoin digital currency. Last week, his tweet revealed that the Bitcoin wallet Mr. Wales addressed and received more than 3,000 dollars or approximately 5 BTCs in combination with valuable donations from enthusiasts of digital currency. Other than this, Jimmy posted over Bitcoin Reddit about his plans to re-open crucial discussion related to acceptance of Bitcoin in combination with board of directors working under Wikipedia Foundation. Lastly, political feedback about Bitcoin highlighted that Bitcoin possesses the potential to undergo significant development in the crypto currency and online trading industry.

The objective oriented programming language Ruby is the combination of both Static and Dynamic programming languages designed in the Rails framework. There are many pre designed data modules available in ruby that is defined with specific codes. A user has the accessibility of codes and can script the codes based on the requirements.

RoR is an open source platform therefore; users will have a wide range of options and modules to choose. The RoR is one of the strongest and most active web development communities on the web. There are many RoR programmers located in various parts of the world offering 24/7 support and solutions for RoR. RoR developers in India are among the most appreciated community members. Along with them, the users themselves have the option to contribute in the open source community and interact with the members.

In the RoR open source community, the users have access to various available modules, themes and codes. They can use all of them to design a much better website in a very less time. Most of the modules available on this platform are free, though some of them are paid. More importantly, users or programmers can access through several videos and tutorials in the community and learn more about RoR. It is by far the easiest way to design a website with full functionality.

RoR is growing and progressing every day. It is been serving the website programmers n developers since over a decade. In the coming years, there would be more upgraded features available to the users to create a highly user friendly and attractive website.

Web development has better a significant meaning in the world of business at the present time, owing to its probable to send worth added services to the client. From business improvement viewpoint, a client or an industry owner is in look into of tools that automate his each day business process such as customer association, register control, a full and total ERP, and maintain organization control panel and situation to deliver exact business snapshots. Maintenance this insignificant want in the brain, a client seeks reliable vendors who can automate this ordinary procedure and free to believe the efforts on commerce development. It is well recognized that 20% of efforts place in trade must deliver 80% of the result. Web development solutions approve the business owners to reach this intended goal.

On the other hand, the most brilliant solution would be to subcontract the growth to someone who is reliable and has made a status all the way through their terrific work. The progress of web growth outsourcing and Ruby on Rails Development in India is seeing on adding to for a variety of beneficial reasons it provides to the customer. The seller as long as PHP development in India, ROR development, or additional prospect and latest technological platforms has been the utmost advantage to a customer. The developers in India are well-informed and clever at their technical skills and are alongside with the ground-breaking inventions that keep on incidence.

Companies have 2 alternatives to get a reliable and appearance driven web realize. Either it can employ developers as domestic supply or delegate the project to a web increase company. Developers using information platforms such as ruby on rails (ROR), PHP, for web development are available, though the knowledge and the aptitude to bring exceptional projects are essential. While commerce plans to employ ruby on rails developer, it have to determine the ability of the applicant all through earlier work talented or allocate a mock progress that will help determining expertise sets. If you decide to hire a a professional of Ruby on Rails Development in India or any additional region of technological experience, it is very significant to know these qualities.

A web development effort can be of diverse needs. It can be website enlargement or a web application. Equally the utilities have a well-known function to have fun and give towards the business procedure. Getting a high presentation leaning web development scheme is fundamental to get top benefits. A flawed web tool which has limits on its arrangement would not be of any utilize and it would be an ineffective effort on the element of the developer to use time on an adequate project.

Ruby on Rails is source of web application development framework that uses Ruby programming language. Ruby on Rails normally is known as ROR or Rails. This is an object oriented programming language, which helps to increase easy, complete and great web applications. ROR is a framework that permits applications to be developed as quicker that uses simple concepts.

Advantages of using ROR

  • It is very helpful for increases database websites and applications.
  • It maintains databases like Postgresql, Mysql and Oracle.
  • It is build up for search engine open URL's for active websites
  • It is model view architecture (MVC) that enables data and reason to be separated from management.
  • It assists in make simpler the coding of general programming languages responsibilities.

There are lots of Ruby on Rails Experts in India that uses regional blogs, social networking sites and community sharing sites. It is demand for open source web development frameworks Rails that can be used to expand web 2.0 applications. It has been set up to be programming languages such as PHP, ASP, and Java and.NET. There are some of the features that have driven Ruby on Rails a well-liked framework between the open source developers' area. Applications are developed quicker using easy methods and less code. It is open resource Ruby framework for increasing database-backed web applications. These web solutions simply using Rails as it works fine with great web servers and databases. It supports databases such as MySQL, SQL Server, SQL, DB2 and Oracle. Furthermore, it helps these programmers to make the applications improved and easy to use. It provides no set phase necessary.

ROR supports fast application growth due to that it is increasing popularity day by day. Ruby on Rails web development assists the rails developers to be doing well in making strong and elegant applications in a more resourceful and less difficult way.

Latest Survey and Benefits

Based on this, musical industry experienced meteoric rise during the past few decades. According to latest reports, revenue from international level of digital music succeeded to reach more than 400 millions of dollars during the last few years. In fact, musical collections shared with the help of websites give huge benefits to both music lovers and artists or labels, which include.

For Labels/Artists

Good websites with options to upload songs and musical collections to be distributed into different channels provide best platform for labels or artists to display their skills and innovation to musical enthusiasts worldwide. Unlike traditional methods of selling CDs and cassettes to a limited area, digital music platform provides artists with an efficient medium to gain popularity at international level and at the same time, a powerful gateway to earn millions of dollars.

For Music Lovers/Audiences

Music distribution websites let users to download their favorite songs in any format and in safest possible way i.e. without any threat to piracy issues. Secondly, the digital sites let music enthusiasts to choose countless numbers of songs sung by their favorite artists regardless any physical boundary. Hence, in this way, digital era has brought drastic revolution in the musical industry as a whole.

Cucumber is a tool that executes plain-text functional descriptions as automated tests. While Cucumber can be thought of as a “testing” tool, the intent of the tool is to support BDD This means that the “tests” (plain text feature descriptions with scenarios) are typically written before anything else and verified by business analysts, domain experts, etc. non technical stakeholders.


Gherkin is the language used to write features, scenarios, and steps. The purpose of the language is to help us write concrete requirements.

4 Steps in Defining a Feature

  • Cucumber begins by defining a “Feature” that we are trying to implement.
  • After that we specify what we want to do using “In Order”.
  • The we specify a user who will be interacting with that feature using “As a”
  • And then we finally specify what do we expect using “I want”


Feature: User login In order to login As a User I want to specify a valid credential and login

Cucumber steps

  • Cucumber internally uses capybara
  • You can use any other acceptance test framework e.g. Webrat


  • Capybara makes it possible to restrict certain actions, such as interacting with forms or clicking links and buttons, to within a specific area of the page
  • You can use within DSL to specify a scope e.g. within(“#form-group”)
  • You can also further restrict it to a table e.g. within_table(“customer-table”)

Both significant factors in software performance are size of the database and program structure. Let's identify the reasons that hinder the applications performance and executive solutions and techniques to improve applications performance. Factors that hinder performance of RoR applications:


  • Variety of a slow period container
  • More use of inefficient helper methods
  • Execution of duties on per request most basic rather than calling everything necessary during startup - Browsing frequently and too many from database
  • Replication of identical computation while processing requests

If you give attention to the condition areas described above, you can certainly boost the performance of Rails Development applications. Better Session container:

Rails framework comes with several built-in session containers. PStore and ActiveRecordStore are two broadly used containers. PStore stores session information in a separate file while ActiveRecordStore stores session information in the database. Both treatment containers slow down action-cached pages, which degrade application performance. You have two better alternatives SQLSessionStore and MemCacheStore. These alternatives increase the performance of action-cached web pages resulting in faster execution of the code that boosts application performance. Reading Cached data:

You should not use class-level caching if you are using same data repeatedly during one process requests. You can simply read the data in the cache, which is much faster and prevents repeated calculations. Get independent computations at startup company:

If any data does indeed not change or any difference in it requires hardware startup, you can refuge this data in some variable in some course of application. Another option is to disable working in Ruby on Bed rails for each action most basic by using silence method. Optimize queries:

Rails have well-defined associations between model classes. Yet , the built-in made accessors are not optimized for performance. The generated accessor methods cause N number of additional queries to the data source and thereby degrading the performance of the program. You are able to resolve this performance issue by adding an: include =>: author to your query parameters, which results in single SQL statement and immediate development of author objects. Keeping away from the use of slower helpers:

All helpers in Rails invoke the course-plotting module to work with URL. The process of invoking routing module and under-going several routes in the road file is a time-consuming process. Rather, you can code the piece in HTML immediately and avoid the stop helper. Optimizing a data source:

Interacting with a repository is a time-consuming process and frequent querying the database severely degrades the performance of the RoR application. Reducing the quantity of SQL queries is one way to increase the performance of RoR app. The other way is optimizing the database, that can be done by following activities:

  • Remove unused indices
  • Add appropriate indices for foreign and private keys and fields used in filtering assertions
  • Revise and optimize SQL queries
  • Partition large tables
  • Use stored procedures
  • Use excited loading of organizations
  • Avoid use of orders when not necessary

Cryptex Technologies ROR developers in India is regularly keep updating on improving application.performance.

Spree is a complete open supply e-commerce solution build with Ruby on Rails. If you wish to show a Rails app into a store that sells merchandise, then Spree is one in all the fastest ways to this.

It really consists of many totally different gems, every of that square measure maintained in an exceedingly single repository and documented in an exceedingly single set of on-line documentation.

You automatically require all of the below necessary gem dependencies when you use spree:

  • spree_api
  • spree_cmd
  • spree_core
  • spree_dash
  • spree_promo
  • spree_sample

All of the gems are designed to figure along to supply a completely practical e-commerce platform. It is also possible, however, to use only the pieces you are interested in. So for example, you could use just the barebones spree_core gem and perhaps combine it with your own custom promotion scheme instead of using spree_promo.

Installing Spree

Spree depends on ImageMagick to handle the image process it will thus we’ll need to install it before we are able to install Spree. The simplest way to do this is to use HomeBrew.

Cryptex Technologies make use of spree in building several e commerce websites.

When you transfer your latest app to a production server and open it up to the globe, you are extremely throwing your app to the elements - smart and unhealthy. If you do not pay any attention to security whatever, you are possible to fall foul of some cracker's villainous theme and your users are protestant when something does not work or they are being spammed with pots of gold to share. however what to do?

There are some precautions to be taken while before launching any application. Our ROR developers in India pay attentions to the following points for security:

  • Some attributes should be uneditable, it will only be read only
  • For security updates and patches dependencies will be check.
  • For user equipped URLs avoids redirection.
  • Beware of mass assignments.
  • Avoid using user params or content within the send_file technique.
  • All non-ActionController methods make private.
  • Avoid storing the password in database.
  • Filter sensitive parameters from the logs.
  • Pay attention to CSRF (Cross-Site Request Forgery) and use protect_from_forgery and csrf_meta_tag.
  • Pay attention to XSS (Cross-Site Scripting) and use the h helper in views
  • Don't trust logged in users.

Ruby concurrency is when two tasks will begin, run, and complete in overlapping time periods. It doesn’t essentially mean, though, that they’ll ever each be running at a similar instant (e.g., multiple threads on a single-core machine). In distinction, correspondence is once 2 tasks virtually run at a similar time (e.g., multiple threads on a multicore processor).

Multiple Processes vs. Multithreading: Processes:

  • Uses a lot of memory
  • If parent dies before kids have exited, kids will become zombie processes
  • More expensive for forked processes to modify context since OS has to save and reload everything
  • Forked processes ar given a brand new computer storage area
  • Requires inter-process communication
  • Slower to make and destroy
  • Easier to code and correct


  • Uses less memory
  • All threads die once the method dies
  • Threads have significantly less overhead since they share address area and memory
  • Threads share a similar memory, thus have to be compelled to management and affect synchronous memory problems
  • Can "communicate" via queues and shared memory
  • Faster to make and destroy
  • Can be considerably a lot of advanced to code and correct

Examples of Ruby solutions that use multiple processes:

Resque: A Redis-backed Ruby library for making background jobs, inserting them on multiple queues, and process them later.

Unicorn: AN protocol server for Rack applications designed to solely serve quick shoppers on low-latency, high-bandwidth connections and profit of options in Unix/Unix-like kernels.

Examples of Ruby solutions that use multithreading:

Sidekiq: A full-featured backgrounding framework for Ruby. It aims to be easy to integrate with any trendy Rails application and far higher performance than different existing solutions.

Puma: A Ruby internet server engineered for concurrency.

Thin: a awfully quick and easy Ruby internet server.

Elasticsearch provides a robust, quiet hypertext transfer protocol interface for assortment and queryinEg knowledge, designed on high of the Apache Lucene library. Right out of the box, it provides scalable , efficient, and strong search, with UTF-8 support. It’s a robust tool for assortment and querying huge amounts of structured knowledge.

Basic Ideas of Elastic search:

Cluster: A cluster may be a assortment of nodes that hold knowledge. It provides assortment and search capabilities across all nodes and is known by a novel name.

Node: A node may be a single server that's a part of the cluster, stores the information, and participates within the cluster’s assortment and search capabilities.

Index: associate index may be a assortment of documents with similar characteristics, like client knowledge or order knowledge. It’s sort of a electronic information service, with mappings that outline multiple sorts.

Type: There are often multiple sorts inside associate index. as an example, in our application we've the GetCount index, that has totally different sections like active user count and inactive user count.

Document:A document may be a basic unit of knowledge that may be indexed. it's sort of a row during a table during a electronic information service, like knowledge for a client or product, and is delineated in JSON format. we are able to have multiple documents in associate index, however they need to be indexed to a kind inside associate index.

Shards and Replicas: associate index will probably store an outsized quantity of knowledge surpassing hardware limits. Elastic Search provides the flexibility to divide indexes into multiple items known as shards, that permits the content to scale horizontally. Elastic Search conjointly permits users to form copies of index shards, that square measure known as replicas.

Elasticsearch also can be used as data store engine, however it's some disadvantages:

Security - Elasticsearch doesn't offer any internal security or access system. the sole thanks to shield metal from external access is with a firewall.

Computation – there's restricted support for advanced computation on the info facet.

Data handiness – knowledge in Elasticsearch is offered in "near real time", - which means that if you submit a comment to a post and refresh the page, it would not show up because the index remains change.

Durability – metal is distributed and comparatively stable, however backups don't seem to be as high priority as in different knowledge store solutions. this can be a crucial thought once Elasticsearch is your primary knowledge store.

Cryptex Technologies Ruby on Rails Developers in india takes a special care while using elastic search.

Rails is constructed on the principle of convention over configuration. Simply put, this suggests that, by default, Rails assumes that its professional developers can follow “standard” best observe conventions and, if you do, things can work for you “auto-magically” while not your desperate to specify these details. whereas this paradigm has its benefits, , it is also not without its pitfalls.

There are some Common Mistakes That Rails Developers Make:

1. Putting too much logic in the controller:

The problem is that the controller object can begin to violate the one responsibility principle creating future changes to the code base troublesome and fallible. Generally, the only types of logic you must have in your controller are:

  • Session and cookie handling
  • Model selection
  • Request parameter management
  • Rendering/redirecting

2. Putting too much logic in the view

The out-of-the-box Rails templating engine, ERB, may be a good way to create pages with variable content. However, if you’re not careful, you'll be able to presently find yourself with an outsized file that's a combination of hypertext markup language and Ruby code that may be tough to manage and maintain. this is often additionally a locality that may result in numerous repetition, resulting in violations of DRY (don’t repeat yourself) principles.

3. Putting too much logic in the model

Many Rails developers truly build the error and find yourself sticking out everything in their ActiveRecord model categories resulting in Mongolian monetary unit files that not solely violate the only responsibility principle however also are a maintenance nightmare.

The only logic that should remain in your model is:

  • ActiveRecordconfiguration
  • Simple mutation methods
  • Access wrappers
  • Sophisticated queries

4: Ignoring your log files

While most Rails developers are aware of the default log files accessible throughout development and in production, they typically don’t pay enough attention to the knowledge in those files. whereas several applications have faith in log observation tools like Honeybadger or New Relic in production, it's conjointly necessary to stay an eye fixed on your log files throughout the method of developing and testing your application.

5. Using too many gems

Excessive use of gems makes the scale of a Rails method larger than it has to be. this could cut down performance in production. additionally to user frustration, this could additionally lead to the necessity for larger server memory configurations and enlarged in operation prices. It additionally takes longer to begin larger Rails applications, that makes development slower and makes machine-driven tests take longer (and as a rule, slow tests merely don’t get run as often).

Refactoring modifies software to improve its readability, maintainability, and extensibility without changing what it actually does. Its external behavior does NOT change but its internal structure is improved.

Benefits of Refactoring:

  • Code size is often reduced
  • Confusing code is restructured into simpler code
  • Refactoring is technique to help you discover problems in design and implementation

Code Examples

class Invoice < ActiveRecord::Base

belongs_to :user



<%= %>

<%= @invoice.user.address %>


class Invoice < ActiveRecord::Base

belongs_to :user

delegate :name, :address, :cellphone, :to => :user, :prefix => true



<%= @invoice.user_name %> <%= @invoice.user_address %>

When do I refactor?

  • When you add functionality
  • When you need to fix a bug
  • When you do a peer review

Code Optimization Tools:

  • Traceroute
  • Rack-Mini-Profiler
  • Bullet
  • Brakeman
  • Deadweight
  • Rails Best Practices
  • Rubocop
  • Rubycritic

If you wants to do an automated-testing for mobile app, then calabash is one of the tool on which you can rely on. This tool helps the user to author as well as execute automated acceptance tests for mobile apps. The app supports Android and other native apps. It is an open source and therefore available free of cost. Developed by Xamarin, the tool consists of libraries that enable test code to interact pro-grammatically with the native as well as the hybrid apps.

The interaction consists of numerous end user actions that can be the following:-

  • Gestures
  • Assertions
  • Screenshots

The calabash helps in automating any IOS or Android based app. The app can be customized according to the needs and requirements of the user. In the context of the app, the Xamarin furnishes the automation framework, the device cloud.

Calabash supports the cucumber which allows the user to express the app behaviour using natural language that can be comprehended by business experts, non technical QA staff. It can be used to write automated acceptance tests with the aid of any Ruby based test framework.

The benefits of Calabash are that it is a perfect tool for acceptance tests. It does not require programming skills in Ruby. The user can only use the steps from the user story, make some minor changes according to the user interfaces. There are online links, websites where the users of Calabash can get enough information about the tool. From the online reviews, it is understood that the tool is popular for acceptance tests.

An artist monetize the created songs by distributing them on different DSPs. There are many platforms available that helps artist to distribute and process royalties. They charge small fees and helps artist in distribution and royalty processing. Just distribution of songs on different DSPs is not sufficient for an Artist. What is required is marketing and promotion. This gives a complete solution to the Artist.

There are different ways for marketing and promotion of a song

Following are some of the Strategies to promote music:

Social Media

These days, if you’re not on Facebook, Instagram and Twitter, it’s virtually such as you don’t exist. However, you'll not be victimization social media to it’s full potential to market your music. We will help you to promote your music in an interesting way. For example, if you’re an artist and released a new album, then we will sprinkling your updates on social media.

Generate traffic

We help you to drive traffic to your website and attracts new fan through social media page. We bring engagement with your existing ans and also encourage new fans.

Music Blog

If you want to promote your music, it isn’t on the subject of sharing things along with your fans. You also may need to achieve new audiences and convert them to fans. Bloggers are always looking for new content. Cryptex Technologies will help t o promote your music through blog and if your music is popular on a blog, it’s guaranteed to be seen by people who already like the genre!

Email Marketing

Your email list is an especially valuable tool to market your music. Email list is promoting to your current fan base. If somebody signed up for your email list, they need to listen to from you, therefore make the most of it! Your emails will be driving your fans. We are able to send thousands of mails at a time to your target audience.

Cryptex gives such complete solutions for Digital Music Distribution. There are many more strategies to promote your music, just join us and experience your popularity!

Earlier every third party tool developed and maintain a custom integration specific to a selected LMS, which was too time consuming and difficult to maintain. Previously, the same application like chat application was created differently for each individual LMS. To overcome these problems an LTI(Learning Tools Interoperability) tool is introduced. Now, you can only create one application and integrate the same with different LMS through LTI. LTI integration allows the seamless application to connect to any LMS which supports the LTI standard. Some of the third party tool which supports LTI are chat application, video, online publisher content, plagiarism detection services, portfolio solutions, online tutoring services, and many more.

LTI(Learning Tools Interoperability) is a standard way of integrating third party learning application with platforms like LMS and other learning object repositories. With the help of LTI you can easily integrate external tools or applications for example Google Hangout into your Learning Management System.


LTI provides the following benefits:

  • Helps in integration of a range of instructional applications, learning tools and content into the LMS.
  • Enables immediate use by college or students, returns the outcomes information and analytics across a large kind of learning tools, applications, and content to LMS.
  • A single sign-on on-line setting for all users.
  • Reduces the quantity of custom integrations needed for product developers as a result of each application interfaces within the same means.

Our qualified development team is expert in integrating LTI with any LMS as well as experts in developing applications that supports LTI.

Code review is meant to seek out and fix mistakes unnoticed within the initial development part, improving both the overall quality of software and the developers’ skills.

Code Reviews Play Higher Estimates

Estimation could be a team exercise,and therefore the team makes higher estimates as product information is unfold across the team. After adding new features to an existing code, the first developer will give smart feedback and estimation. Additionally, any code reviewer is additionally exposed to the quality, noted problems, and issues of that area of the code base. The code reviewer, then, shares within the information of the first developer of that a part of the code base. This apply creates multiple, wise inputs that, once used for a final estimate continually makes that estimate stronger and reliable.

Code Reviews Alter Time without Work

Nobody likes to be the only real purpose of contact on a chunk of code. Likewise, no one desires to dive into a crucial piece of code they didn’t write–especially throughout a production emergency. Code reviews share information across the team so any team member will take up the reins and continue steering the ship. However here's the point: with no single developer the toughest path, it conjointly suggests that team members will take time without workPRN. Code review is the best way to refresh your mind.

Code Reviews Mentor Newer Engineers

A special side of agile is that once new members be part of the team additional seasoned engineers mentor the newer members. And code review helps facilitate conversations regarding the code base. Often, groups have hidden information among the code that surfaces throughout code review. Newer members, with recent eyes, discover knotted, time-plauged areas of the code base that require a brand new perspective. So, code review conjointly helps guarantee new insight is tempered with existing information.

The Ruby on Rails is a powerful software development tool. To use it, one requires being an expert in the Rails software. There are tips to become an expert Ruby on Rails developer. Basic knowledge in the subject, good classroom mentoring and practice are the essential things that make a qualified ruby on Rails developer. Following are some of the best ways to learn the Rails technology:

Start with a solid foundation on the subject

Mastering the Rails 5 may appear to be a daunting task as there is hardware, software, different languages, databases, networking servers, front and back end involved but despite all this the subject is really easy to grasp. If you have computers, laptops with system software programs installed in it then you can feel comfortable to practice the rails on command line, text editor as well as IDE.

It is important to have a knowledge of data modelling and SQL.

Know Ruby

To grasp the subject better, the readers need to have a have a thorough understanding of the objects, classes and methods in Ruby.

Pick the Resources

To learn Ruby on Rails, the resources that are helpful includes the following:-

  • In-Person courses
  • Online Tutorials
  • Books
  • Documentation

Practice to be an expert Ruby on Rails developer

Though theory is important but there are small exercises which if practiced well gives a level of proficiency in the subject that is very much appreciable.

Code in Rails, Build Projects

After attaining the proficiency level, it is important to engage in doing live projects in Rails.

Ruby on Rails is an open source web application system for the Ruby programming dialect. It is uniquely intended to be utilized by the web designers for fast advancement. In the same way as other web systems, Ruby on Rails utilizes the Model-View-Controller structural planning example to sort out application programming. It incorporates devices that make normal improvement assignments less demanding.

On the off chance that you take after the right traditions, you will have the capacity to keep away from long arrangement of documents and you can have more opportunity to concentrate on business rationale.

On the off chance that you are an engineer, here are some valuable focuses of Ruby on Rails experts in India might want to impart to you. These focuses will make your occupations simpler.

Incorporate Characterized Module Structure

Rails have a very much characterized module structure that permits the clients to introduce and utilize modules in the application effortlessly. David Heinemeier Hansson, the organizer of Rails expressed that he utilized 5-6 modules as a part of every Rails application. Being the engineer, you do not have to squander your time composing the system. You simply need to make utilization of the composed module accessible in the business sector that gives the usefulness you require. You can likewise dump or stack information by issuing a Rake charge. You can look at the information you require effectively.

Make Sure about Ease Operation of the Project

In request to expand our work effectiveness, we have to ensure that the project can run easily. When you are working with Rails, you will have the capacity to do "robotized testing" to guarantee that you do the right things. This testing enhances your work process and builds your trust in the outcome.

Cryptex Technologies provide full support to our customers, and build scalable robust secured web app on ror.

PayUmoney Integration

01 Jun 2016

Payumoney offers electronic payment service to your website through its various partnerships with banks. Through payumoney your client would be able to make electronic payments through credit card or net banking or debit cart.

Payumoney also offers to merchant(owner of website) for online transaction details, settlement reports, analytic reports etc. There is two types of login is provided by payumoney one for buyer and another one is merchant.

PayUmoney Integration

1. Put gem ‘payuindia’ in gemfile and run bundle install.

2. We have to put this form where into where you want like cart page.

PayUmoney Payment Process

  • The consumer select the product on your website and clicks on “pay now” button.
  • The consumer get the transection page of payumoney. Here consumer will enter all payment related details Payu send the consumer details and account details to the right bank.
  • The bank verifies the consumer tell we there the transaction is success or failure.
  • Payu pass the customer back to merchant website along with the confirmation whether the transaction is fail or success.
  • Merchant shows a success or failure message to consumer.
  • Technical Integration

    The payment process flow to move the consumer from step1(click on pay now) to step 2(getting PayUMoney page from payu) post request generated need by merchent to following given url

    Production server:


    Test server:


    Response Status

    There is different types of responses status given by Payumoney

    • Not started – The transaction is not started yet

    • Initiated – The transaction has been started but not completed

    • Refunded – The transaction amount is Refunded

    • Partially Refunded – The partial amount Refunded

    • Failed – The transaction is failed

    • Completed – The transaction is successfully completed

Ruby on Rails is a popular framework used to develop applications. The framework written in Ruby is based on the MVC architecture. Using ruby on rails, it becomes simple to develop fast applications with the least set of code, effortlessly.


Devise is an authentication solution developed for Rails on Warden. The software has the following attributes:-

  • It is rack based
  • It is an MVC solution that is based on the rails engines
  • The software allows the user to have more than one role that are signed at the same time
  • It is based on the modularity concept. The developer can use what he really needs

Creating the rails application

Before creating the first Rails application, it is important to go through the basics of the devise software. The user can install the ubuntu 11.04 operating system in the computer, and work with the rails project. Alternately, the user can install rails in the Windows or Mac system as well. Once the dependencies are installed, the user can start creating the application. There are commands which help the user in creating applications in rails.

While creating a simple Ruby on rails application using Devise the developer has to take in consideration certain other aspects of development that are mentioned as follows:-

Gemfile editing

The developer will need to add the gem in the Gemfile with:-

  • gem 'devise

Devise installation

  • Run the bundle command to install it.
  • After that, the developer will need to run the below command to install the gem
  • rails generate devise:install

Model creation

  • Run the below command
  • Rails generate devise MODEL
  • Replace MODEL with the class name used for the application’s users

View Creation

  • Run the below command
  • Rails generate devise:views
  • Controller creation
  • Run the below command
  • Rails generate devise:controllers MODEL(s)

To know in details about how the rails applications are created, Cryptex Technologies is ready to help you.

Are you contemplating on installing the latest version of Bootstrap into your Rails project? Then you need to know which version of the Rails application you are using. The recent version of Rails is 5.0 and to create a Rails project, it is imperative to add a bootstrap to it. The newest version of bootstrap used for this purpose is Bootstrap 4.0.0-alpha.

Generate the Bootstrap CSS, JavaScript Files

This gives a new Rails app. The next step is to generate the bootstrap CSS, JavaScript files. In order to do so, it is important to visit the official bootstrap page for the alpha version, download the source files from there. The archive needs to be unpacked and CSS files need to be generated from the sources. Generating the Bootstrap CSS, JavaScript files involves a number of steps that include grunt-cli, navigating to the bootstrap folder, installing local dependencies, create gemset to isolate the dependencies, install bundler, install ruby dependencies, generate the CSS, JavaScript.

Load the Bootstrap

After generating the bootstrap CSS, JavaScript files, the next course of action is to load the bootstrap in the rails app. The loading of the bootstrap, too, involves a number of steps that one needs to follow. Details about the bootstrap loading process can be obtained from specific online contents. Later the user of Ruby on rails can initiate the server using rails s, load app in the browser by hitting localhost:3000.

This is how Bootstrap is integrated into Rails. Cryptex Technologies are expertise in integrating bootstraps into Rails.

Ruby on rails programming has risen as an undeniable web improvement innovation, all on account of the solid group of expert and devoted engineers. The system of Ruby on Rails takes after the key of MVC (model, view and controller) engineering. It can be characterized as an article situated scripting dialect and was initially presented back in the year 1990. Rails - is fundamentally a structure, which is composed in Ruby programming dialect.

Various organizations associated with Ruby on Rails Development in India lean toward this programming dialect, as it is straightforward, adaptable and discernable. Likewise, the effortlessness and nature of structure makes this programming dialect so capable. Taking after are a percentage of the foremost advantages, which make it so famous among Ruby on rails designers:-

  • It results in fast improvement of use. Indeed, it is conceivable to assemble Rails application effortlessly in less time, than you can ever envision.
  • It is extremely adaptable and in this manner reacts to different changes in the prerequisites all through the task length.
  • It is open source and offers part of advantages like new coding strategies, group backing and parcels more.

The greater part of the above is the advantages of ROR (Ruby on rails) system for designers. Presently, let us investigate the advantages of Ruby on Rails Development in India structure for various entrepreneurs, who work in co-appointment with Ruby on rails developer for their individual ventures:-

To abridge the entire substance, it can be said that every one of the things clarified above were an essence of ROR system and the advantages offered by it. To delve into more refined points of interest or data about Ruby on rails programming or Ruby software engineers, you can just search significant sites, which will give you data to the same in a much exact manner.

  • Changes can be made effectively
  • Websites can be dispatched rapidly
  • Cost-powerful alternative

Ruby on Rails is the most prominent web application development framework done using Ruby language. Ruby on Rails frequently called RoR or Rails is an open source web improvement system and an item arranged programming language that creates basic, complete and intense web applications with rich intelligence and usefulness.

RoR work utilizing the Model-View-Controller Design Pattern and it is most preferred among Ruby on Rails engineers as a result of its rationality of CoC (Convention over Configuration), DRY (Don't Repeat Yourself), and close relationship with the coordinated advancement procedure. The fundamental point of interest of utilizing Ruby on Rails is the lithe way of improvement, what takes months on different stages, takes just week to create on Ruby on Rails.

Ruby on Rails was initially extracted from Basecamp by David Heinemeier Hansson in July 2004 and it is truly simple to convey web arrangements utilizing Rails as it functions admirably with an extensive variety of web servers.

A portion of the components which have driven Ruby on Rails web Development a mainstream structure amongst the open source designers' group are:

  • Applications are developed quicker utilizing straightforward strategies utilizing less code.
  • An open source Ruby system for creating database-supported web applications.
  • Easy to convey web arrangements utilizing Rails as it functions admirably with extensive variety of web servers and databases that actualize CGI or Fast SGI.
  • Supports databases like MySQL, SQL, SQL Server, DB2 and Oracle and helps the Ruby on Rails developers to make the applications better and easy to use.
  • Cryptex Technologies is known to use Ruby on Rails web Development in most appropriate manner.

Digital Music software is extensively used these days because of its ease and interface to employ. Without going to the studio, anybody can create a melodious sound that can feel the feeling. There is no need of any expensive and heavy instruments. Indeed, it lessens the expenses of buying melodic instruments and paying the musicians. The only expenditure you need to do is for buying the music software. There is a lot of free software out there that you a usable, but there will definitely be limitations on using this software. Therefore, it is essential to find the right software according to requirements.

First, in order to create better music that your relatives and friends want to hear must include the proper tools and alteration to create the desired music. If you have been looking for the digital music distribution software, you must be conscious of it that there are a number of packages presented, but not all of them are excellent enough to create better digital music. Since you are looking for the great software, it is recommended to discover after doing in profundity research.

Like any other thing you purchase, you do not precipitate for it and the same is the case when selecting the top digital music distribution software. Do some proper study on the internet, inquire different experts, study the reviews, evaluate the prices and appear what the overall rating of the music software is.

Ensure to have seem through the software information that will assist you know the characteristics that are provided in it. In order to get the top music software it is necessary to have good knowledge. Find-out the pros & cons of the software and have an investigation of each one that you have reviewed. In this technique, you will come across different advantages and after reviewing them, you can select the best one.

Cryptex Technologies have been delivering such solutions by developing a digital music distribution software like which we already developed.

ROR is recognized as Ruby on Rails, which is usually identified as Rails. It is an open resource web framework, particularly designed to augment lively websites and web applications. It is clever developers to improve their production and create great web applications. With its many things, Rails have earned lots of reputation.

Ruby on Rails emphasize on two main beliefs. First, meeting over pattern and the next one is Don't Repeat Yourself (DRY). They will converse in relation to both features in the prospect paragraphs.

Hiring Cryptex Technologies developers gives you the benefit of utilizing resources as per your requirements. Our ROR developers in India are having full knowledge of the latest tools and technologies to deliver projects on time.

Standard of Ruby on Rails

  • Ruby on Rails is holed up on Model View Architecture (MVC). MVC construction isolates the picture of the detail from the client message through it.
  • It refers to a sketch that allows the customer to access the data in a confirmation. Database Access or active record guide makes simpler data use. It maps get on to classes and rows to substance unwillingly.
  • This characteristic lets the developer to use once more the codes as much as possible rather than copy them. It helps to reduce the alternative of fault and keep the code clean.
  • There are no XML outline files in ROR. The Developer wants to make out only unconventional aspects of the use. It has only simple programming meeting that can be used to confirm the agreement parameters.

The concept of using Bitcoin for making varying transactions has become widespread. Integrating Bitcoin payment gateway has become highly beneficial for all the types of business, but for online businesses and eCommerce site, the success rate is tremendous.

As per a survey report the number of Bitcoin transactions per day is showing continuous growth without any drop-down.

In the early January 2014 the rate of traction was around 63 thousand, however, in due course of time i.e. around October 2015 the transaction rate crossed 2,42 thousand. Isn’t it mind blowing? This statistic brilliantly portrays the constant and surplus increase in the number of Bitcoin transactions.

The best explain that will show the actual popularity of Bitcoin transaction is the fact that Amazon and Ebay, the two most renowned eCommerce websites have also integrated Bitcoin payment gateway for processing Bitcoin transactions.

How to Integrate Bitcoin Transaction Gateway

Novice people or people who have recently got introduced to Bitcoin transaction find the integration process very complex, time consuming and expensive.

This indeed was true, until, Cryptex Technologies came up with their innovative and technical sounds methods for implementing Bitcoin transaction gate. Their techniques make the whole process quite simple and stable i.e. it is not prone to any sort of failure in future.


It is truly said that getting solution to any problem is not difficult; the only task is to find the right solution source. Cryptex is the solution source that helps majority of their clients in integration of Bitcoin payment gateway. Cryptex hold specialized expertise in this regard, hence, it is considered as ‘One Stop Shop’ for availing experts assistance in solving the most complex technical issues.

Mobile Application Testing is a process by which a developed application of a mobile device is tested for its functionality, Consistency, Usability.

Types of Mobile Application Testing

1. Functional Testing

The Functional testing of mobile app normally consists in the area of user interactions as well as transactions. Functional testing includes :-

  • Validation of required mandatory fields.
  • Validation of application allows social network options such as sharing, posting, & navigation.
  • To Validate whether the application works as per as requirement whenever the application starts/stops.
  • To validate whether the phone is able to store, process and receive SMS whenever the app is running.
  • To validate that the application supports any payment gateway transaction such as Visa, Mastercard, Paypal etc as required by the application.
  • To validate whether the application performs according to the requirement in all versions of Mobile that is 2g, 3g and 4g.

2. Performance Testing

  • Validate whether the response time of the application is as per as the requirements.
  • Validate application performance when network is changed to WIFI from 2G/3G or vice versa.
  • Validate the network performance while moving around with the device.

3. Usability Testing

The fundamental objective is to ensure that that the mobile app is easy to use and provides a satisfactory user experience to the customers.

Usability testing Includes:

  • To ensure that the buttons should have the required size and be suitable to big fingers.
  • To ensure that the icons are natural and consistent with the application.
  • To ensure that the validation for the tapping zoom-in and zoom-out facilities should be enabled.
  • To ensure that the application items are always synchronized according to the user actions.
  • Usability testing is normally performed by manual users since only human beings can understand the sensibility and comfort ability of the other users.

4. Compatibility Testing

Compatibility testing on mobile devices is performed to ensure that since mobile devices have different size, resolution, screen, version and hardware so the application should be tested across all the devices to ensure that the application works as desired.

  • To Validate that the application must be compatible with different OS versions.
  • To ensure that the developed application should be responsive across different screen resolutions.

Cryptex Technologies take a special care of all these as well as very religiously follows Functional Testing, Performance Testing, Usability Testing and Compatibility Testing.

Ruby on Rails is the acronym for ROR that serves as a framework of open source web application written mainly in Ruby programming language. This framework helps users to create internet applications and dynamic websites irrespective of the complexity associated with the project. The framework mainly resides on restful application design, while the creation of its software architecture remains across client-server relationships.

Key Principles of the Technique

Ruby on Rails operate with two key principles, where first one is do not repeat oneself and the second one implies convention rather than configuration, which make them relatively more efficient and less complicated from various other types of open source frameworks. In addition, ROR framework sidelines various prior assumptions and open new ways to design web applications emphasizing mainly on simplicity.

Benefits of Ruby on Rails

Until now, ROR has fulfilled large numbers of applications for modern business, based on which it has become popular in the web development industry. These are:

Market Launch Quickly as Possible

Programming process associated with Ruby on Rails mainly takes place at relatively fast rate and code length reduced to a huge extent. This leads to very less possible consumption of time related to website development process and thereby, launch of new website in the market within less possible duration.

Content Management

Whenever you intend to supply the website with video and audio files, ROR becomes an ideal choice, which provides users with easy navigation facilities at the time of browsing any website. If this is not enough, Ruby on Rails never allows users to compromise on scalability and performance associated with designed websites.

Cryptex Technologies Ruby on Rails Developers in India maintains best code version with the help of tools.

Digital music distribution has recently brought unprecedented and radical variations in the entire music industry. It has given the sector an entirely new dimension and high pedestal undated within the entire history of music. In other words, musical business has achieved a significant facelift with the availability of digital distribution platform.

Digitization Leads to Large Numbers of Audience Worldwide

Innovative digital distribution technology allows artists to rip and compress their artwork and thereby, to send over a specific network. This leads to the creation of large numbers of audiences for music and songs even for various unfamiliar languages. In this way, music received a huge exposure in the digital platform.

Lets Artists to Promote Musical Collections

Framework of music has recently undergone significant variation. The reason for this is that several musicians now started promotion of their music live and music labels usually encourage them to open and operate their own downloadable stores. Before the concept of digitization, most of the labels, singers and individual artists have to rely on sales of their recorded labels. However, nowadays, sales and release of album no longer remain in hands of labels, as they easily put out their collections, albums and similar others with less possible upfront investments. Therefore, artists and labels have the opportunity to market and promote their collections directly to the music platforms. Lastly, digital distribution system assure for secured payment methods and other special benefits in the form of royalty processing, load balancing, auto correct options, all of which inspire people to go for digital music distribution.

Exceptions are equally old as programming. It’s an amazing fact that since the time programming was done using basic primary level programming language, exceptions were used to make some required alternations in the program flow. This further helped in avoiding failure. “Exception handling is the process of responding to the occurrence, during computation, of exceptions – anomalous or exceptional conditions requiring special processing – often changing the normal flow of program execution”.

Exceptions require special treatment because unhandled exceptions can cause unforeseen behavior, which is difficult to handle. The best example of unhandled overflow exception was the famous Ariane 5 rocket launch, which failed.

Efficient Exception Handling Is Very Beneficial

The programming world is moving more towards OOP i.e. object-oriented programming hence, exception support has become an inevitable aspect of modern programming languages. Vigorous exception handling systems has been developed for different languages, one of the best example is Ruby.

It’s not necessary that codes always have some problem. They may seem perfect but in due course of time it can cause code errors, which can further cause harm to the code base.

There are different recommended practices that help in embracing exceptions:

Maintainability: With this, bugs can easily spotted and fixed without hampering the functionality.

Extensibility: This helps in adding extra elements in the existing code base, which can be further implemented without causing any damage to the existing functionality.

Create your own Application Error Hierarchy

Almost all the programming languages come with a variety of exception classes that are evenly organized in an inheritance hierarchy just similar to any OOP class. In order to preserve the Maintainability and Extensibility of codes it is very crucial to create own sub-tree of application-specific exceptions that can be extended further. Hence, devoting some time to construct own hierarchy can be very beneficial.

Cryptex Technologies makes use of all the industry sound practices for having an efficient programming work flow.

These days, the term wire frames is frequently used by people in the software industry. Wire frames actually act as a bridge between creative thoughts and the final output. Wire frames are equally important in development projects just like blueprints are there in the architectural field. Just in life it is not possible to build a sound building with a blueprint, similarly it is not possible to develop effective software without wire frames.

Web development and software rely to a great extent on wire frames for ensuring the appealing visual representation. The main reason behind this is that wire frames perfectly communicate the different components, relations and processes with a system.

Let’s take a look on some of the stone breaking benefits of wire-frames:

  • Project stakeholders plan and strategize will always be on time and will never get delayed.
  • Developers will also be able to account the expected outcomes, on using the different components of the system.
  • Projects developed by using wire frames have sound interface, hence, the cost of revision come to minimum.

There are some justified reasons why project managers and developers pay due stress on the use of wire-frames for the development process.

Wire frames can be as simple as hand-drawn diagrams that provide an appropriate visual effect of the system in process. The visual representations need not to be in detail and that is why experts refer them as a skeleton. From development point of view, wire-frames give an exact idea about the spacing, position and navigation of the website. Hence, things become very easy.

Cryptex Technologies is one of the renewed names in the field of software industry; they religiously follow the concept of making wire frames before starting with the development process. That is why the applications developed by them are more effective and user friendly.

With every passing day, the demand for effective web applications are increasing at a very faster rate. Considering the stiff competition that is prevailing in the software industry, people look for output in the minimum possible time frame. In order to facilitate software companies in the fast development process some hosting services have been introduced. These web based hosting services provide web based repository for distribution revision control and source code management. There are many such online hosting services available but the most popular ones are Github, Bitbucket and Gitlab. Developers can use these software development tools for storing their codes for future reference.

The main advantage of using Github is that it is a distributed version control system. If some server dies, and these systems were collaborating with it, any of the client repositories can be copied back up to the server to restore it. You can also collaborate with different groups of people in different ways simultaneously within the same project.

There are a number of benefits of having a secured access to code repository:

  • It keep the track of your changes , admin can track the who added or deleted the codes.
  • These are version control. You can always go back to a previously committed code, or just recover certain files from a previous commit.
  • It superseded previous version control systems like CVS and SVN.
  • You can also easily provide access to other users, both on and off campus instead of needing to email or copy to a sharing service like dropbox.
  • It's helpful for people collaborating with other people.
  • It is very useful for working with distributed location.

Initially, some doubts were raised on the accessibility of the codes by different location. However, the concerned was resolved in a way that admin of the repository can access the repository from anywhere. They can simply log in to the respective hosting service provider such as Github, Bitbucket or Gitlab with the credentials.

Now, one common question that may strike the mind of majority of people is regarding the security codes stored in these sources. Well, answer to this question is that all these sources are very much secured because of limited access. It is admin who have all the rights to share the access and can do anything with the codes.

Cryptex Technologies, is one of the renowned software companies that have their own Gitlab server where they store their codes. These codes are solely used for their in house projects. This also helps them in saving considerable amount of among on Github and Bit-basket.