Posts - Page 8
Personal blog by Karina Baha.
-
Select Records Created within the Last X Months in Ruby on Rails
In Ruby on Rails Feb 2, 2022
Suppose we have a blog application, and we want to show on the index page only the latest posts. Say we want to show the posts created within the last three months. How can we do that? We can use t...
-
The Root Route in Ruby on Rails
In Ruby on Rails Feb 2, 2022
When developing a web application, the most important thing is to set what to display on the home page. In Ruby on Rails, we specify what we want to show on the home page by defining a root route.<...
-
Difference between URI and URL
In Web Jan 23, 2022
In this post, we'll discuss the difference between a URI and a URL. A Uniform Resource Identifier (URI) is a string that identifies an abstract or physical resource. A Uniform Resource Locator (URL...
-
Member and Collection Routes in Ruby on Rails
In Ruby on Rails Jan 18, 2022
The routes of a Ruby on Rails application live in the config/routes.rb file. The Rails router matches a request in the browser to a controller action. The Rails default for routing is the resource rou... -
Using form_with With Nested Resources in Ruby on Rails
In Ruby on Rails Jan 14, 2022
In this post, we will deal with using the form_with helper with nested resources in Ruby on Rails. We will build a blog application, and the blog posts will have comments. We will nest the two reso...