Ruby on Rails:使用Action Mailer寄信(使用 google smtp)

在Ruby on Rails環境下要發送email,以下是步驟:

一.修改設定檔
修改config/application.rb,加入以下

config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
  address:              'smtp.gmail.com',
  port:                 587,
  domain:               'gmail.com',
  user_name:            'your mail address',
  password:             'your mail password',
  authentication:       'plain',
  enable_starttls_auto: true  }

Continue reading “Ruby on Rails:使用Action Mailer寄信(使用 google smtp)”

VIM編輯器:自動縮排指令

在VIM編輯器中若要進行縮排,以下可以參考

在.vimrc中加入以下指令
filetype plugin indent on
set cindent shiftwidth=4

然後在編輯檔案時,輸入以下指令
gg #移動到最上層
v #進入visual模式
G #跳到最後一行,相當於全選
最後輸入 = ,它就幫妳縮排好啦!!

以上提供參考~