Rails ActiveRecord Relation (Arel), composition and Query Objects
Ruby on Rails ActiveRecord::Relation (or Arel) is really handy tool to create complex SQL calls. In this article I'll show you several tricks I've came across over the years and show you how to combine them to Query Objects and Query Interfaces
POST != Create and PUT != UpdatePOST
Ruby on Rails developers tend to think that HTTP method POST represents Create and PUT means Update. Well, not really. The CRUD mapping of modern web-frameworks just limits the scope of this HTTP methods for sake of simplicity in code design. Read more in this article what they really stand for.
PATCH vs PUT and the PATCH JSON syntax war
There is still lot of confusion on PUT vs PATCH HTTP methods and the JSON syntax. In this article I will try to explain the difference and present pragmatic solution to PATCH syntax problems.
Setting up Ubuntu 16.04 for Ruby on Rails app (Cheatsheet)
Quick cheatsheet how to install various technologies for Ruby on Rails application under fresh Ubuntu 16.04 machine
Set up AWS Elastic Beanstalk
In this article I will show you how to Set up AWS Elastic Beanstalk Docker environment, RDS, ElasticCache and Security Groups for demo Ruby on Rails application.
How to configure Route 53 to Cloudflare
How to properly set up Cloudflare with Route 53
Various CORS issues related (not only to) Ruby on Rails
CORS may be bit tricky (not only) for Ruby on Rails application. In this article we will have a look on some problems and solutions I've dealt with.
Simple Authentication for one user in Rails
In this article we will bulid simple session based authentication for one user for Rails from scratch.
Pure RSpec JSON API testing
In Ruby on Rails there are many tools how to test your JSON API, but you don't necessary need to install any gems. RSpec provide really decent tool set for many scenarios including APIs
AWS ElasticBeanstalk deployment hooks
How to run post and pre deployment scripts on AWS Elastic Beanstalk running (not only) Docker environment
Ruby Enumerable, Enumerator, Lazy and domain specific collection objects
Ruby has couple of nifty tricks up its sleeves to deal with collection objects so that they map your domain. In this article we will look on Enumerator, Lazy Enumerator and Enumerable and how to implement API collection objects in Plain Ruby so that they can be used in similar way as you would use Rails scopes
RSpec be_within matcher
RSpec 3 be_within matcher for comparing values in delta range
Rendering Paperclip url via Elasticsearch without making calls to ActiveRecord DB
Rendering Paperclip attachments / urls vith Elasticsearch without ActiveRecord calls.
Common AWS Elastic Beanstalk Docker issues and solutions.
Several debugging tricks for AWS Elastic Beanstalk runing Docker
Some debugging tips for Ruby on Rails
Several debugging tricks for Ruby and Ruby or Rails developers
Spring Cleaning for WebDevelopers
After while our machine, Github, server, ... gets piled with old unneeded stuff, here are sme tricks & commands I use for Spring Cleaning in my machine
Different ways how to do contextual Rails validations
Ruby on Rails has a decent way how to ensure that invalid params won't end up in DB. Problem with Rails Validators is that they are bound to a class rather than Instance object. In this article we will have a look on few workarounds to do context validations.
Rails redirects to wrong host (NginX HTTP_X_FORWARDED_HOST)
Problem I had where NginX was passing wrong HTTP_X_FORWARDED_HOST to Rails and me spend several hours debugging.
Ergonomics and faster typing practices for Web Developers
Ten Finger Typing Technique, Dvorak layout, Split Keyboards and Vim. All this are Techniques and Life Hacks that can improve your productivity and development experience.
Setting up simple Wordpress deployment with CodeShip to AWS EC2
This article will show you a simple way how to set up deployment of a WordPress website via CodeShip
Chromebook for Web Developers
You don't need expensive laptop to be a web-developer or sys-admin guy, all you need is an attitude to get things done. In this article I'll give you my experience on developing commercial web-application backend via chromebook
Build Docker images on your machine or in the cloud ?
Docker images can be build either on local computer or via hosted build servers. Although we all are fans of cloud automation, should we really let hosted solutions build the images for us? Isn't that against Docker philosophy?
Scissors Rule in coding
In coding / software-developing world a rule called Scissors Rule exist several years. Funny enough I couldn't google single article about it :) . In this article I'm summarizing it's base principles
cron rbenv bundle exec rake task
Ruby provide so many easy ways how to create a scheduled job (Whenever gem, Daemons gem, ...) but what if you want to configure something really simple with plain cron along rbenv?
config.force_ssl is different than controller force_ssl
Rails provide option force_ssl as a global seting and as a controller method. They act the same way in terms of redirect to https but have a huge security affect on cookie security.
Ruby Ancestors, Descendants and other annoying relatives
In Ruby is easy to pull "ancestor" classes of a class. However once developer want to work with "descendants" he may find it's not that easy. This article is providing a way how to look at Ruby ancestor tree
JSON array in html element data attribute
How to pass JSON to HTML element data attribute
RSpec matchers in db:seed file
There is overall confidence that seed files (rake db:seed) don't need any additional testing. But in this article I will show you easy way how to add simple layer of tests during the seed process.
Translating locales for Rails model errors
Proper way how to translate Rails validation messages
Mail interceptor for different Rails environments
Rails mail interceptor to prevent sending emails from being sent for different environments using custom environment configuration options.
RSpec performance improvements with before allExample
Improve your test-suite performance by properly using before(:all), after(:all) RSpec hooks so that you trigger less database queries.
Render image with Rails controller
How to stream images with Ruby on Rails controller so that you can fake that images are located on your server.
Jenkins CI for Rails 4, RSpec, Cucumber, Selenium
Jenkins CI to test your Rails app with RSpec Cucumber (Spinach), Selenium and also doing tested deployments.
Temporary enable dalli store in RSpec specs
Ideally when you're running tests you don't want to cache anything, but there are some cases that you need to make sure stuff is working with caching enabled. This article will show you how to temporary enable Dalli cache for some of your specs
Installing rbenv on Ubuntu machine
set up rbenv on Ubuntu
Installing Nginx 1.4.4 from source on Ubuntu 12.04 (Precise)
Step by step manual to install NginX on Ubuntu 12.04 (Precise) from source with SNI support without headache.
Shoulda matchers depricated. Now what ?
Thoughtbots team behind gem shoulda_matches have decide to depricate several matchers in version 2.0. Lot of people still find them useful. Read more to see alternatives.