tmux new [-s name] [cmd](:new) - new session
tmux ls(:ls) - list sessionstmux switch [-t name](:switch) - switches to an existing session
| class User < ActiveRecord::Base | |
| validates :phone_number, presence: true, length: { is: 11 }, if: :gsm_number_empty?, unless: :password_or_email_changed? | |
| validates :gsm_number, presence: true, length: { is: 11 }, if: :phone_number_empty?, unless: :password_or_email_changed? | |
| private | |
| def password_or_email_changed? | |
| encrypted_password_changed? || email_changed? | |
| end | |
| def phone_number_empty? | |
| !phone_number.present? |
| # It extends activeadmin to show pretty boolean values | |
| # | |
| # config/initializers/active_admin.rb | |
| module ActiveAdmin | |
| module Views | |
| class TableFor | |
| def bool_column(attribute) | |
| column(attribute){ |model| model[attribute] ? '✔'.html_safe : '✗'.html_safe } | |
| end |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
| #Model | |
| @user.should have(1).error_on(:username) # Checks whether there is an error in username | |
| @user.errors[:username].should include("can't be blank") # check for the error message | |
| #Rendering | |
| response.should render_template(:index) | |
| #Redirecting | |
| response.should redirect_to(movies_path) |
As configured in my dotfiles.
start new:
tmux
start new with session name:
| # Additional translations at https://github.com/plataformatec/devise/wiki/I18n | |
| tr: | |
| devise: | |
| confirmations: | |
| confirmed: "Eposta adresiniz başırılı bir şekilde onaylandı." | |
| send_instructions: "Bir kaç dakika içerisinde eposta adresinizi nasıl onaylayacağınız hakkında bir eposta alacaksınız." | |
| send_paranoid_instructions: "Eğer eposta adresinizi veritabanımızda kayıtlı ise bir kaç dakika içerisinde eposta adresinizi nasıl onaylayacağınız hakkında bir eposta alacaksınız." | |
| failure: | |
| already_authenticated: "Zaten giriş yaptınız." |