How do you make sure every member in your team follows best coding practices and never commits code with issues to remote repository? Answer is overcommit gem and git hooks. You can configure overcommit gem to run RuboCop on modified codes before committing those code to git
#ruby on rails
RuboCop is a static code analyzer which analyzes the code based on the best practices followed by the Ruby developers around the world and defined on the community Ruby style guide. In this article, we will learn: What is RuboCop? Why use RuboCop? and installing RuboCop in Rails.
Yes! You can create a full functioning search engine with Rails. In this tutorial you will be learning how to create a search engine with Rails by using elasticsearch. You will learn to configure elasticsearch in the rails app, create search view to search and show results and bonus feature of highlighting matched texts like Google does in it's search results.
We can update static values of existing records with the method update_all. But what if we want to update records with different value for different attributes? In this blog, we will be looking at the solution on updating multiple records at once in Rails when each record can have different attribute and value.
It's always tricky when we need to override default behavior of engine/gems. It was the same case with date format. Rails Admin uses long date format as a default value for formatting the dates, to override the format we can add keys for the long date format in our locale files
Fix for the error: PG::UniqueViolation: ERROR: duplicate key value violates unique constraint 'users_pkey' DETAIL: Key (id)=(43957) already exists
A server is already running. Check .../tmp/pids/server.pid This error means the rails server suspended or stopped abruptly, due to which background process is already running on the port that rails server was previously running on.
Live streaming files content to browser in Rails can be accomplished with the use of Server Side Events. In this tutorial, we will be learning to live stream content inside log files to the browser from Rails controller by using file watcher and server side events.
Factory Bot is a ruby library for setting up test data objects in Ruby. Today we will be setting up Factory Bot in Rails which uses RSpec for testing. Factory Bot helps developers to write less code while testing with the factory objects that is created for each model.
There are multiple ways to fix missing top level class documentation comment in Rubocop. You can disable it in your whole app with by disabling cop in the whole project, disable it in one class or just add a comment above the class declaration.