Guest

Untitled

By: a guest on Jan 28th, 2012  |  syntax: None  |  size: 0.77 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. ## config
  2. ...
  3. config.i18n.default_locale = :es
  4. FastGettext.silence_errors
  5. FastGettext.locale = 'es'
  6.  
  7. ## module with constants for options in form
  8. module CompanyFormOptions
  9.   BUSINESS_TYPE = [
  10.     [I18n.t('business_type.fabricante'), 1],
  11.     [I18n.t('business_type.comerciante'), 2],
  12.     [I18n.t('business_type.agente'), 3],
  13.     [I18n.t('business_type.distribuidor'), 4],
  14.     [I18n.t('business_type.ministerio'), 5],
  15.     [I18n.t('business_type.asociacion'), 6],
  16.     [I18n.t('business_type.otros'), 7]
  17.   ]
  18.   ...
  19. end
  20.  
  21. ## view
  22. - CompanyFormOptions::BUSINESS_TYPE.each do |bt|
  23.   = check_box_tag "company[business_type][]", bt[1], @company.business_type.include?, bt[1].to_s)
  24.   = bt[0]
  25.  
  26. ## error at rendering
  27. translation missing: en, business_type, fabricante
  28. ...