small medium large xlarge

Img_0013_pragsmall
09 Feb 2010, 23:06
Xavier Décoret (7 posts)

I cannot find a ‘standard’ answer about model helpers. I have model that shares very similar custom validation. I want to stay DRY, so I am looking for the rails-ish way to move that in a central way.

But it does not seem there are model helpers (tried scaffolding, nothing is generated; did several unfortunate attempts).

What would be your suggestion?

Dave_gnome_head_isolated_pragsmall
10 Feb 2010, 00:01
Dave Thomas (390 posts)

I put them into a module and simply include it or extend it (depending on whether I want to add validation instance methods or those class level validations)

You must be logged in to comment