Guru on Rails

if you don’t sacrifice for your dream then your dream becomes your sacrifice.
Will Nguyen

Ruby on Rails


Mon 06 Aug 2018

Ruby on Rails Design Patterns

What are the reasons for using Inheritance and Composition. Speaking of Inheritance, we refer to class, for Composition we refer to Module. We should know the main idea from this design. Why do we ...


Wed 15 Aug 2018

Software Architecture Ruby on Rails Design Patterns

Have you ever considered about using class inheritance or modules while coding? So, when do we decide to use inheritance instead of module? Coding design is just about arranging code in our applica...


Wed 29 Aug 2018

Ruby on Rails

Let's have a look on how to implement singleton methods in Ruby. will = 'Will Nguyen' def will.hello puts "#{self} says hello" end If we have many methods need to be implemented. class << wil...


Wed 29 Aug 2018

Ruby on Rails Best Practices

In fact, Ruby on Rails (ROR) does help us a lot. It makes our code shorter. It's close to the natural language. The syntaxes are pretty nice. I can't agree more about these things. However, as a Ru...


Thu 06 Sep 2018

Ruby on Rails

Hook methods is actually the convenient way to help us extend the behaviors of existing class at runtime. In rails there are many popular hook methods we often use such as "included, extended, inhe...


Thu 04 Oct 2018

Ruby on Rails

Rails 5 finally provided an easy way to add realtime communication between Rails 5 server and web browser. Rails 5 Action Cable integrates the web sockets to the the rest of Rails application realt...


Wed 01 Jan 2020

AngularJS Javascript Ruby on Rails

Imagine that we have a rails application which have been running for more than six year. Suddenly, we have a requirement about realtime feature. We have two choices. The first one is using third pa...


Wed 01 Jan 2020

Best Practices Ruby on Rails Design Patterns

I have been coding for many years. I read many books about clean coding and practising them myself. I found that the rule for clean code is Decoupling. Another the name is Isolation. You might know...


Sat 04 Jan 2020

Data Structures Ruby on Rails Best Practices

In order to design this function we need to know self-join technique first. Now let's have a look. 1. Self-join SELECT employees.*, managers.name as manager FROM users as employees JOIN users as m...


Sat 18 Jan 2020

Ruby on Rails Performance

How do people work good in the morning and performance decreases gradually until Evening? If we don't mention the spirit cause computers don't have it (lol), so the cause is the amount of workload....