Posts

Showing posts from January, 2019

Cron job in Ruby on Rails application – A Complete Tutorial for Beginners

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 the 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 action as...

Six rules to make Ruby On Rails code Crisp, Absolute and Clear!

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 the most widely adapted style. This improves the readability of our code.  Rule No. 2:   Name it well! Naming convention should be foll...

Everything you need to know about ‘The Cryptocurrency Exchange'

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 installation , 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 priced 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 priced 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 ...