class eval and instance eval in Ruby – Meta programming
class_eval class_eval allows us to define a method within the class outside of its original definition and without reopening the...
class_eval class_eval allows us to define a method within the class outside of its original definition and without reopening the...
includes – Uses eager loading and optimally used when accessing each member attributes from the associated records. joins – Uses...
In ruby, which method gets executed when we extend or include it to the class. Which method has more precedence,...
Ruby is the flexibility it gives you to do the same thing in many different ways, so you can choose...
CSRF Stands for Cross Site Request Forgery. First of all, let us know what is a CSRF attack and how...
You would have been using redirect_to root_path in your controller action. We also have used redirect_to root_url. So are they...
One of the interview questions in Ruby on rails would be What is STI…? How would you implement it…?. But...
1. Not using associations properly Say, we have association of College has many students, having foreign key college_id in student...
Every real-time application needs to deal with Date and Time.In rails, Time, Date and DateTime classes reside inside ruby library,...
nil is the Ruby object, not just a keyword, that represents nothingness. Whenever a method doesn’t return a useful value,...
Recent Comments