JDutil / contact_us

Gem providing simple Contact Form functionality with a Rails 3+ Engine.
http://contact-us-demo.herokuapp.com
MIT License
135 stars 57 forks source link

Custom fields #41

Open asiniy opened 10 years ago

asiniy commented 10 years ago

I think many users, not just I, need custom fields, like phone, address, et.c. Can I refactor list of custom attributes with their validation like that:

config.fields = [:email, :phone]

validates :email, presence: true, email: true
validates :phone, numericality: { only_integer: true }, allow_nil: true

Is there any way?

If no, I want to refactor this gem and provide the ability to make a custom fields

JDutil commented 10 years ago

If you would like to refactor to work with configurable fields I would accept it so long as it is fully tested. I don't have the time or desire to make that sort of change myself since it is already pretty simple to extend it to do what you want as it is with a decorator.