Rubocop is a linter for Rails. Rubocop helps in enforcing best practices for Ruby and Rails. It helps in maintaining consistency throughout the project. It also has option for autoformatting the code based on the configurations.
#ruby on rails - Page 2 of 3
In this part, we will learn about how we can perform transactions in the external mysql database using mysql2 gem. Transactions helps us in making multiple queries to database ensuring all queries are performed or none at all.
In this part, we will learn about how we can perform prepared statements to the external mysql database using mysql2 gem. Prepared statements are very useful against SQL injections.
In this part, we will learn about how we can insert and update records to the external mysql server using mysql2 gem. We will add two new methods to our service that can insert and update records to mysql server using mysql2 gem.
Database interaction is very simple in rails with Active Record but what if you have to communicate with external mysql server? Gotcha! Let's create a service to perform queries we want without using Active Record.
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.
Many times when working with pure sql queries for example, we need to extract keys and values separately. Learn how you can extract key or value from hash in Ruby on Rails.
This is the second part of a 2 series tutorial to setup action mailbox with postfix. In this part, we will configure postfix in production server to forward incoming emails to our rails app so action mailbox can process it.
This is the first part of a 2 series tutorial to setup action mailbox with postfix. In this part, we will implement action mailbox with postfix and test it in development.
Learn how you can generate random and unique number or token from given range of number in Ruby on Rails.