Step-By-Step Guide to Building Your First Ruby Gem

rubyonrailsdevelopment Jul 12, 2016

Nowadays all the functionalities in Rails are built as Ruby gems. For example we can use devise gem for the authentication part of the application. It’s like a package or library that is written in Ruby programming language. Moreover it can be imported and used by others in their programs.

Step 1 B...

SOCKET LIBRARY IN RUBY ON RAILS

rubyonrailsdevelopment Jun 8, 2016

There are basically two levels of accessing network services in case of rails .

The socket and network libraries are such important parts of integrating Ruby applications with the Internet and other communications-based environments.

One is through socket libraries provide low level access to conn...

Text values for enum

mustai Feb 14, 2016 1 thank

There is way to have text values for enum. It is useful to have localized select options and latin values in database.

  1. User model: enum kind: { 'текст'=>'text', 'изображение'=>'picture', 'звук'=>'audio', 'видео'=>'video' }
  2. Edit view: <%= select_tag 'user[kind]', options_for_select(User.kinds,...