Custom field example for Ruby on Rails with Activerecord & PostgreSQL & Metaprogramming


Sometimes instead of specific db fields, you want to store custom field on database that is changing according to user needs in same app.

I coded following method to store this type of dynamic data. As you see in codes, it uses metaprogramming methods.

Also, there is simple validation to custom field that is number.

There is simple rails app that is using this type of custom field method. You can access source code below link:

If you want to demo, there you go:

Happy coding..

Please follow and like us:

Leave a Reply