Ruby on Rails company - the header image

Ruby on Rails code quality

In this article we will point out steps on what can you do in order to improve your code quality in Ruby on Rails apps that you are building. Follow up Ruby style guide Yes, let’s start from basics. You can read community driven Ruby style guide at Follow up Rails style guide You […]

Lodash library usage examples

Lodash library usage with JavaScript Using lodash library Usign lodash library makes you not reinvent weel when writing JS code. The good definition is :”Applicative programming is the pattern of defining a function that takes a function and then invokes that function for each element in a collection/list” A very neat example you can find […]

Elastic search on Rails

Elastic search is a mirror db with indexes of your existing DB, which is seachable trough JSON API. In order to perform search you will need to have the data synced between your DB and ElasticSerach. This can be done via rivers to pull data from your application or to push data to your ES […]

Live Reload for Rails

Have you ever wanted to make changes in your Rails app and to immediately see changes in Browser? If so, you can consider using Live Reload Rails feature Install livereload Ubuntu sudo apt-get install python-livereload Install Chrome extension Enable http fecth in settings or Use rack Start live reload livereload ~/projects/project-name/app Add guard-livereload […]

Rails delegate

A model should only talk to it’s immediate association. According to law of demeter, you shouldn’t talk to the association’s property or association’s association. Here we talk about Rails delegate approach BAD SMELL class Profile < ActiveRecord::Base belongs_to :user end <%= @profile.user.address %> <%= %> Rails provides helper method to acomplish delegation, which uses […]

Server firewall configuration

There are two ways to start thinking about your server firewall security. The hard way or the easy way. The easy way would be to start thinking before something bad has happened to your server, and now you can figure out what would be the hard way.. In order to get the security of your […]

Carrierwave upload multiple images

These are the steps to enable upload multiple images/files using carrierwave in rails 4+ from scratch. Similar procedure can be applied for nested forms. In gem file gem ‘carrierwave’ bundle install rails generate uploader Avatar Create post scaffold rails g scaffold title:string rails g scaffold post_attachment post_id:integer avatar:string rake db:migrate post.rb class Post < ActiveRecord::Base […]

Install Mongo DB

In order to install Mongo DB you can create a bash script and run following lines sudo apt-key adv –keyserver –recv 7F0CEB10 sudo echo “deb dist 10gen” | tee -a /etc/apt/sources.list.d/10gen.list sudo apt-get -y update sudo apt-get -y install mongodb-10gen Running sudo service mongodb start Should start the service. If you encounter the […]

Install NodeJS on Ubuntu

Install NodeJS on Ubuntu machine in few easy steps: sudo apt-get install python-software-properties python g++ make sudo add-apt-repository ppa:chris-lea/node.js sudo apt-get update sudo apt-get install nodejs Node Package Manager (npm) is installed along the way.

Install Ruby on Rails on Ubuntu

Instructions on how to install Ruby on Rails on Ubuntu. You can copy paste following code and save it in script and execute it. This way it will install everything in one go. Full installation of Ruby on Ubuntu usually takes around 10-15 minutes. If you see something that would need updating, please let us […]