Ruby read json file to hash


In Ruby read json file to hash can be achieved using File Handling. Example to parse json file to hash is illustrated with this tutorial. What is JSON? If you are new to JSON (JavaScript Object Notation) you might want to read Introduction to JSON Require JSON You need to require JSON before JSON parse, thus […]

Ruby Draw line on Image using RMagick


In Ruby draw line on image, draw circle on image/ various shapes can be drawn using RMagick gem. To install RMagick gem you need to add RMagick in Gemfile Add RMagick in Gemfile gem 'rmagick' Source: Github/RMagick Install the Gem Bundle the Rails project to install rmagick if not already installed bundle install After successful […]

Pagination in Rails with will_paginate gem

will_paginate Github Source

Pagination in Rails can be implemented easily with will_paginate gem. will_paginate modifies Collection of ActiveRecord in a way to implement pagination. What is will_paginate?   It is Pagination Library for Rails Querying for Records and Displaying Page Links can be automated using this gem Source: Github - will_paginate   Steps for integration of will_paginate with […]

What is attr_accessor in Rails?

attr_accessor is used to define an attribute for object of Model which is not mapped with any column in database. This answers question - What is attr_accessor in Rails. 1. attr_accessor Methods attr_accessor creates two methods i.e. getter method and setter method. getter method - it is used to retrieve value of the attribute setter […]

Rails Migration Difference between Text and String

While working with Rails Migration Difference between Text and String is important to be known to every developer. Columns and their data types are finalized while deciding Table structure. This tutorial will help understand difference between String and Text column type and illustrate how to write Rails Migration implementing the same. You might want to […]

How to integrate Semantic UI Rails with Rails App

Semantic UI

Semantic UI is the new popular CSS, JS framework for beautifying your Website. Tutorial will help understand how to integrate Semantic UI with Rails application and how to test the sample Semantic UI components with your Rails application. What is Semantic UI According to Semantic UI - Semantic empowers designers and developers by creating a […]