I always forget all those handy hints in Ruby on Rails, while using my Rails console. Here I will drop some very useful console commands to get some daily jobs done: Hint No.1 Sometimes we change the code in a file. In that case we can reload the changes in the rails console by using […]
Read more at the sourceCategory Archives: Ruby on Rails
8 things I look for in a Ruby on Rails app
As a consultant, I’ve looked over a shitload (how many? probably ~150-200) over the last 12 1/2 years in the Ruby on Rails community. I haven’t worked on most of them, but I do get invited to look over, review, audit, and provide feedback on a lot of those.
Over on the Planet Argon blog I’ve shared my quick hit list of a few initial things that I look for when looking over an existing code base.
Read Ruby on Rails Code Audits: 8 Steps to Review Your App
Read more at the source[ActiveRecord] Get a polymorphic owner class out of the owned object
The question is: how can we retrieve a owners class of a polymorphic association without loading the owner object into memory? Solution There are (at least) two ways to do this. First one is not recommended (as it might fail with multiple namespaces with same class names, etc: or a better one that will work […]
Read more at the sourcePostgreSQL is the preferred database of Ruby on Rails developers
The 2016 Rails Hosting community survey results are in. One of the numbers that I’m tickled with joy about? 84% of Rails developers said they’d prefer to use PostgreSQL.
We won!
Check out all the survey results at http://rails-hosting.com/
Read more at the sourceRuby on Rails, Mysql2::Error: Incorrect string value: ‘\xF0\x9F\x99\x82’ and Specified key was too long; max key length is 767 bytes
If you get error like this one: it means that you use verion of Mysql with settings that does not support full Unicode. Changing that in Ruby on Rails should be fairly simple: However you might encounter following error: 767 bytes is the stated prefix limitation for InnoDB tables. To fix that you need to: […]
Read more at the sourceUpgrading to Ruby on Rails 5.0 from Rails 4.2 – application use case
In this article, I’ll try to cover all the issues that I had, when I was upgrading one of my Rails app from Ruby on Rails 4.2 to Ruby on Rails 5.0. Note: This is not a complete, covering every possible case tutorial. You might encounter issues that I didn’t. If so, feel free to […]
Read more at the sourceAction Cable demo by DHH in Rails 5
David was kind enough to put together a demonstration of how to take advantage of Action Cable in Rails 5.
In the video he puts together a small chat application.
Read more at the sourceUpload Videos Using Carrierwave-video & FFmpeg
If you want to upload videos to rails application, and you wish to modify it on the fly, you archieve that by using FFMPEG.
Read more at the sourceVagrant Box for Rails Development
Vagrant is a tool that allows you to create shareable and reproducible development environments.
Read more at the sourceActiveRecord isolated, namespaced scopes and methods using instance_exec and ActiveSupport::Concern
Rails concerns are a really good way to provide shared functionalities into your models. For example you can add scopes and then apply them in multiple classes: One of the downsides of this solution is a “models pollution”. Every model in which we want to include our module, will get all the methods and scopes […]
Read more at the source