我想将所有网址存储在可读的utf8
中class User < ActiveRecord::Base
require 'addressable/uri'
require 'idn'
include IDN
def service_url=(url)
url = Addressable::URI.parse Addressable::URI.unescape(url)
url.host = Idna.toUnicode url.host
super url.to_s
end
end
重构或更多通用宝石的任何提示?