When I do scaffold generated code for a table that has "enum" in it and i goto to the "new" button, no options are given. Anyway i could automate it so i can get a drop down box when using enums? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060128/3af188e0/attachment.html
OK, let me restate this, i looked at the wiki but it seems cumbersome, isn''t there a helper or plugin, or something to reduce code redundancy when doing enums? On 1/28/06, zbyte pepsi-hola <zbyte64@gmail.com> wrote:> > When I do scaffold generated code for a table that has "enum" in it and i > goto to the "new" button, no options are given. Anyway i could automate it > so i can get a drop down box when using enums? >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060128/124c954f/attachment.html
I *think* mysql is really the only db that supports enums, that''s probably why rails doesn''t bother with them. Personally, I don''t think enums should be used, because my opinion is that the data validation should be done at a higher level (in this case ActiveRecord). So just use a varchar in your table and use validates_inclusion_of in your model. -Jonny. zbyte pepsi-hola wrote:> OK, let me restate this, i looked at the wiki but it seems cumbersome, > isn''t > there a helper or plugin, or something to reduce code redundancy when > doing > enums?-- Posted via http://www.ruby-forum.com/.