pluralize与i18n的配合

April 09, 2012

locales文件

en.yml
1
2
3
4
:en
  :nights
    :one => '1 night',
    :other => '%{count} nights'
zh-TW.yml
1
2
3

:zh-TW
  :nights     :one => '1 晚',     :other => '%{count} 晚'

view层

1
    view <%= t( ".nights", count: @nights ) %> 

在ActiveAdmin下自定义filter

rails4之后,之前的`model`里加入`search_methods :filter_name`的做法已经失效,需修改为:``` ruby class PromoCode (ids) { with_tags(ids) } def self. …… Continue reading

Mac上搭建Phonegap环境

Published on October 02, 2014

Rails遗留程序里最常犯的错误(译)

Published on July 23, 2014