Category / Rails

Uploading Audio/Video/PDF with Action Text


Action Text is a very powerful rails feature which uses Trix editor from basecamp under the hood, In this article we will understand how to use ActionText to work with different media format.

Let's create a new Blog Application for this demo.

1
2
rails new action-text-demo -d postgresql
rails g scaffold Blog

Install action text into your app

Read More

Active Record delegated type


Rails 6 has added a new feature that adds delegated_type to Active Record. In this blog post, we are going to learn how to use delegated_type in our Active Record model using a real-life project and also discuss the benefits of using it.

Project

Implement a School Management System. The system will have Users with different profiles. eg: Student...

Read More

10 Rails Antipatterns to avoid - Writing well reasoned code


Ruby on rails certainly makes it easier for developers to bootstrap applications and POCs at a pace which is hard to imagine achieving using any other framework. The MVC architecture of the framework ties up together many pathways which speeds things up in terms of development speed. And as a consequence, it brings along with a few antipatterns...

Read More

RAILS SERVE STATIC FILES with NGINX


Rails 4.2+ has introduced an environment variable in production ENV['RAILS_SERVE_STATIC_FILES'] which disallows serving static files and assets by default.

1
2
3
# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present...
Read More