Ruby on Rails: Switching MySQL Database Based On Current Git Branch

At Dexcode, we uses Git heavily and follow the Git flow process described here: http://nvie.com/posts/a-successful-git-branching-model/. Often times, we work on a separate branch which modifies the existing databases or sometimes the master and develop branch is so far apart that we wish that the database switch…

Ruby Framework VS Native Ruby

Are you use a Ruby framework to build a website? Or just with native Ruby code? If you are using a Ruby framework to build a website, what is the framework you are used? Why you are choose that framework to develop a website? What about the other frameworks? Have…

Track Session Id Change on Devise

Devise change session id? The same question poped up when earlier on our project we need to keep track of what session id being used. Yes, Devise change session id, sometimes. It happen after authenticate user and after logging out user. On after authenticate user, only session id that being…

Decryptable password with Devise

When using Devise to handle user authentication for a Ruby on Rails application, Devise will transform password into a hash before stores it in database. The hashing process or encryption inside Devise, by default, is using BCrypt. BCrypt is a one-way hash function, means hashed password can not be decrypted…

Rails 4: Force SSL Protocol

In config/routes.rb: Rails.application.routes.draw do resources :sessions, :constraints => { :protocol => "https" } end or Rails.application.routes.draw do scope :constraints => { :protocol => "https" } do # All your SSL routes. end end…

Customizing ActiveAdmin Form

At Dexcode, we love ActiveAdmin. We've been using it in a couple of projects and we love its simplicity and elegant design. In this article, we want to share our experience with ActiveAdmin as a way for us to contribute back to the Ruby on Rails community. When customizing ActiveAdmin,…