Rails is a robust, flexible, and beginner-friendly framework for creating web applications. It follows the MVC (Model-View-Controller) design pattern, which helps keep the application organized, modular, and maintainable. Let’s delve into the intricacies of the Rails directory structure, explaining the purpose of each folder and file. Ruby on Rails: File and Directory Structure at a…
Continue ReadingTag: Gemfile
Displaying Public Activity with public_activity gem
Activity Logs An activity log is a record of logs that track user actions performed in an app. Activity logs are useful, because if something goes wrong, an user can check their activity log and see where they messed things up. Activity logs are common in social media sites like facebook, even github has one….
Continue ReadingAdding Upvotes & Downvotes in your rails app
The Acts As Votable Gem We can add likes/dislikes like youtube or upvotes/downvotes like reddit with a gem called ‘acts_as_votable’. This gem provides an easy process to add a voting functionality in your app. With this gem we can add upvote/downvote buttons and also count the number of upvotes/downvotes and display them easily. Github Link:…
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 ReadingDeploying fails on heroku? here’s what you can do to fix
Use heroku logs Heroku logs often provide in-depth useful information for debugging your rails apps, it shows us the exact block of code where the bug exists, sometimes it can be because of a typo or a problem with gem versions or something else. We can also use heroku logs with –tail to continuously get…
Continue Reading