As a Rails developer, you’re likely familiar with ActiveRecord, a core Rails component functioning as an interface for data stored in a database. ActiveRecord’s power lies in its ability to establish associations between models, simplifying complex database operations execution. Let’s take a comprehensive tour of ActiveRecord associations, their various types, and their implementation in Rails…
Continue ReadingTag: index
SEO friendly URLs with friendly_id
What is a SEO friendly URL ? So, normally rails’ routes looks like these: ‘/posts/122’, ‘/photos/45531, ‘blog/posts/54222’ and so on. This is because rails finds the resource’s records by looking at the record id. This is alright for private applications like research apps, academic apps, management apps, etc. But, if you were to build a…
Continue ReadingAdding Pagination With Kaminari
Why Pagination ? As our list of record accumulates, we would not want to show the entire list of records in a single page, as this is impractical and will cause our rails app to get slower and slower and as well as degrade the performance of our database server. So, an easy way to…
Continue ReadingAdding Search functionality with ransack
Why a search functionality ? Why not? why not to make life easier by adding a simple search button ? its perfectly fine if i have ten or hundreds of records. But what if i have thousands or tens of thousands of records, i or any other user would not want to waste time by…
Continue Reading