search for: fieldname_types

Displaying 1 result from an estimated 1 matches for "fieldname_types".

2006 Jul 12
5
DRY version of RoR book PAYMENT_TYPES example
...Skype'', ''A'' => ''AIM''}, and in views call it: <%= User::IM[user.communicator] %>. But I would be more DRY if in views you could use: <%= user.communicator_to_m %>. This shouldn''t be difficult to implement: - add Hash to a model: FIELDNAME_TYPES = [[''S'',''Skype''],[''A'',''AIM'']] - create additional methods like fieldname_to_m which will get a value and convert it to human readable form using model''s array/hash Before I try to hack RoR I would like to get some f...