Latest Posts

Personal blog by Karina Baha.

  • Difference Between Path and URL in Rails

    In Rails, we often use the _path and _url helpers to link to various resources in our applications. But, what’s the difference between the two?

  • Replace Confirm Dialog Box with Sweet Alert in Ruby on Rails 6

    In this post, we will discuss how we can integrate the Sweet Alert 2 library into a Rails 6 application. We will build a simple to-do app, and will replace the default confirm dialog box triggered by links such as delete links, with a sweet alert. We will use Rails 6.1.4.1 and Ruby 3.0.3.

  • Nested Resources in Ruby on Rails. Let’s Build a Dictionary!

    In this tutorial, we will deal with nested resources in Ruby on Rails. This is useful when there is a has_many association corresponding to a belongs_to association between two models. We want to emphasize this logical relationship using nested routes. We will build a dictionary with letters, and each letter will be associated with words…

  • Uploading Images in Rails 6 Using Active Storage, Trix and Cloudinary

    Active Storage is a Rails module used to upload files to a cloud service. Cloudinary is such a service and, in addition, a complex platform that enables developers to store, transform, optimize, and deliver images and videos. Cloudinary has a free plan available, and it’s quite easy to get started with them. Trix is the…

  • “Hello World” Application using Ruby on Rails 6

    This article is a brief introduction to web application development in general and, in particular, to Ruby on Rails. We will create a simple application that will display the text “Hello, World!” in the browser.

  • Using JavaScript in Ruby on Rails. Let’s Build a To-Do App!

    Rails has a lot of built-in helpers that simplify the process of adding Ajax/JavaScript functionality to our applications. Rails uses an unobtrusive scripting adapter (UJS) that provides helpers to assist in writing JavaScript code. We can make use of these helpers by adding data- attributes to our HTML elements. This, combined with Ruby helpers which…

  • Ruby on Rails Forms. Let’s Build a Sign-Up Form!

    Rails has a lot of built-in helpers that assist in generating HTML markup. HTML forms can have complex structures that’s why using these helpers can simplify quite a lot the process of building such forms that are very important for any web application. In this tutorial, we’ll deal with building an HTML form using the…

  • Import Bootstrap into a Ruby on Rails 6 Application

    In this article, we will discuss the steps needed to import the Bootstrap library into a Rails 6 app. We will import the 5.1 version, which is the latest version at the time of writing.