--Matt Jones
> --
> You received this message because you are subscribed to the Google Groups "Hobo Users" group.
> To post to this group, send email to hobo...@googlegroups.com.
> To unsubscribe from this group, send email to hobousers+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/hobousers?hl=en.
>
I18n.t("#{name.tableize}.#{value}", :default => value)
Which then gets used by the default EnumString input tag in Rapid.
You'll also need to set the name of the class:
ProvTerr.set_name('ProvTerr')
(this should probably be handled better, maybe by defaulting the name method to return self.class.name perhaps?)
--Matt Jones
On Sep 21, 2010, at 11:14 AM, tjg wrote:
class Document < ActiveRecord::Base
hobo_model
Region = HoboFields::Types::EnumString.for(:ab, :bc, :mb, :nb, :nl,
:ns, :nt, :nu, :on, :pe, :qc, :sk, :yt, :other)
...
(config/locales/app.en.yml)
en:
document/regions:
ab: "Alberta"
bc: "British Columbia"
...
This is for Hobo 1.3. The corresponding manual page is available, you
just need to know where it is, (the cookbook displays the stable manual).
https://github.com/tablatom/hobo/blob/rails3/hobo_fields/test/rich_types.rdoctest
We can set the name explicitly to avoid the slash:
class Document < ActiveRecord::Base
hobo_model
Region = HoboFields::Types::EnumString.for(:ab, :bc, :mb, :nb, :nl,
:ns, :nt, :nu, :on, :pe, :qc, :sk, :yt, :other, :name => "Region")
...
en:
regions:
ab: "Alberta"
bc: "British Columbia"
...
cheers,
Bryan
--
You received this message because you are subscribed to the Google Groups "Hobo Users" group.
To post to this group, send email to hobo...@googlegroups.com.
To unsubscribe from this group, send email to hobousers+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/hobousers?hl=en.