1 day agoMember-onlyRuby Coding Interview Question: Find the Greatest Common Divisor (GCD) of Two NumbersSolution def gcd(a, b) b == 0 ? a : gcd(b, a % b) end puts gcd(24, 36) #=> 12 Let’s break down the code and understand how it works: The gcd method takes two parameters, a and b, representing the two numbers for which you want to find the GCD. …Programming4 min readProgramming4 min read
May 28Member-onlyRuby on Rails Coding Interview Question: Find the Second Largest Number in an ArrayPreparing for a Ruby on Rails coding interview may be a stressful commitment. With the correct information and practice, though, you can confidently demonstrate your skills and obtain your desired job. …Programming4 min readProgramming4 min read
May 21Member-onlyRuby on Rails Coding Interview Question: Reverse a StringPreparing for a Ruby on Rails coding interview may be a stressful commitment. With the correct information and practice, though, you can confidently demonstrate your skills and obtain your desired job. …Ruby Interview Questions4 min readRuby Interview Questions4 min read
May 13Member-onlyBecome a Rails Background Job Pro: Replicating Active Jobs with Pure RubyWhat? Background jobs are processes that operate in the background of a web application, independent of the primary user interface and request/response cycle. It permits you to execute lengthy or resource-intensive duties asynchronously, without obstructing the main thread or affecting the user experience. In a typical web application, the user sends…Programming5 min readProgramming5 min read
May 6Member-onlyBecome a Rails Association Pro: Replicating has_many with Pure RubyUnderstanding the has_many Association In Ruby on Rails, the has_many association is used to define a one-to-many relationship between two models. It allows us to easily access a collection of associated records for a particular record. This association is one of the most commonly used in Rails applications. To understand how the has_many association…Ruby On Rails4 min readRuby On Rails4 min read
Apr 22Member-onlyBecome a Rails Association Pro: Replicating has_one with Pure RubyWhat? The ActiveRecord Object Relational Mapper (ORM) is one of its most potent features. This ORM offers a straightforward user interface for interfacing with relational databases, which is another one of its strengths. The ‘has_one’ association is extremely useful in Rails since it enables users to associate one record with another…Programming3 min readProgramming3 min read
Apr 16Member-onlyRSpec Shared Examples with Ruby on RailsWhat? RSpec shared examples are a utility that is used in Ruby applications to cut down on the amount of code repetition that occurs in tests. They let programmers describe a certain action or situation only once and then use it in a number of different tests and specifications. …Rspec5 min readRspec5 min read
Apr 8Member-onlyBrakeman with Ruby on RailsWhat? Brakeman is a security scanner for Ruby on Rails applications. It looks at the source code of a Rails application for possible security flaws, such as SQL injection, cross-site scripting (XSS), cross-site request forgery (CSRF), and other problems. Brakeman makes a report with information about the problems it has found…Brakeman5 min readBrakeman5 min read
Apr 1Member-onlyActive Model Serializer With Ruby on RailsWhat? Active Model Serializers is a Rails gem that lets you change the way your data is shown in JSON format. When you request data from a Rails API endpoint, the answer is in JSON format and contains all of the ActiveRecord model’s properties, as well as any other models that…Programming3 min readProgramming3 min read
Mar 25Member-onlyGit Hooks with Ruby on Rails — part 2What? Git is a technology that is essential for software development teams because it enables teams to collaborate on projects and manage changes to source code. However, when projects increase in size and complexity, it may become challenging to keep up with the many activities required in the Git process. This…Git Hooks3 min readGit Hooks3 min read