Google has loads of services, and Firebase is one of my favorites because it provides lots of easy to use services that help me write one app for web and mobile. Today I’ll do a quick sample of how to use the authentication service from Firebase in your rails application. Most of it is javascript…
Tag: rails
ActionText – the new rails WYSIWYG editor framework
https://edgeguides.rubyonrails.org/action_text_overview.html In many projects we have the requirement to have a rich text editor available, for full documents, user profiles, blog posts, comments, product descriptions, … And every time we think, which editor to use, some times we just get our current favorite, or the one we used in the last project, in my case…
Beware of rails default_scope – it might come back to bite you
Beware of default scope, most of the times it appears to be helpful, it will just be causing you hidden bugs to deal with later
Simple and easy way to use ActiveRecord without Rails
After a question in my other post about how to use sidekiq without rails, I decided to also post here how to use ActiveRecord without Rails, the basic idea is the same, we’ll start with an empty directory and create the files as we need.
Do not trust ActiveRecord data consistency validations, delegate that to the database
Of course you can still use AR validations, that is not my point. But data consistency related validations should not trust AR for that, for example, if you have a “unique” constraint, and you are just trusting the database, it is really easy to break the DB consistency if for some reason you have a…
How to deploy your dockerized rails app to AWS
Back to docker and Rails, we’ve talked some time ago about how to dockerise your rails app, using docker and docker-compose to share a development environment configuration. To do that, we’ll use ECS service, that is the Elastic Container Service, this will allow us to build a docker container image, upload it to an ECS…
6 Sidekiq tips and tricks for performance, mantainability and happiness!
This is a very opinionated post, with some performance tips from someone that uses sidekiq for more than two years now, as as such I have already did some mistakes and learnt some tricks. My current opinion is that sidekiq is the best backend job engine for ruby/rails applications. And of course to use it…
Do you wanna see tabular data in your rails console? check here to learn how!
Have you ever thought about how Rails console was not built for you to read the results of a query that returns more than one object? So, you are not the only one, and that is why there is a gem called ‘hirb’ that will blow your mind, it will make pretty tables of the…
Are you tired of typing always the same things on Rails console? what if you don’t need anymore?
After you spend some time working in the same Rails project, being this project whatever project you are working for some time now, you probably use the Rails console a lot, many reasons: Testing code Seting up data Using “binding.pry” to “debug” some controller or model Put whatever you are doing in “rails c” now…
Learn how to make your Rails logs smarter with log_tags!
When you look at the logs of your application in development, they may appear clear and concise to you (probably not thou), but when you are looking at the production logs and there are many simultaneous requests, sometimes it is difficult to know exactly what like of the log is the next entry, or what…