2

I am using Ruby on Rails 3.0.9 and I am planning to add a simple "Contact us" form to my application in order to make it possible that a user can contact our team. For that I would like to run validation and "friends" functionalities and (to avoid to implement that myself and) to use a third party software, but...

... what gem (or plugin) do you advice to use? what is the most widely "approved" gem for this kind of things?

Of course I would like to use a gem in "active developing" (that is, whose developers are active).

Kristian
  • 21,204
  • 19
  • 101
  • 176
Backo
  • 18,291
  • 27
  • 103
  • 170

3 Answers3

5

Generally I would go with a rails engine to add this functionality and the contact_us plugin an excellent example, it's also under active development (last commit 5 days ago) so you can be sure it's not abandon-ware.

Andrew Nesbitt
  • 5,976
  • 1
  • 32
  • 36
  • The 'contact_us' gem require 'Formtastic' (that I don't know very well)... is it better to use "directly" 'Formtastic' instead of 'contact_us'? What about 'Formtastic'? – Backo Aug 07 '11 at 08:18
  • Formtastic is a plugin that adds some syntactic sugar to the rails form builder, it wouldn't provide contact form functionality on it's own. – Andrew Nesbitt Aug 07 '11 at 08:28
3

I think it's not to complicated to do it on your own (pretty fast)? I hardly think it needs a separate gem to do this (especially if for example contact_us requires additional dependencies (formtastic)).

As for me, it's just a simple form, with action directed to your own Rails mailer.

See: ActionMailer in Rails 3, Form helpers in Rails 3

schiza
  • 1,900
  • 1
  • 15
  • 18
  • I would like to add also validations and friends for my form. – Backo Aug 07 '11 at 08:20
  • friends? as for validation, then you should create a model (without migration, see [here](http://stackoverflow.com/questions/315850/rails-model-without-database)) – schiza Aug 07 '11 at 08:28
  • "friends" means 'ActiveModel::Conversion', 'ActiveModel::Naming', ... because I know about 'ActiveModel'. – Backo Aug 07 '11 at 08:36
  • The stackoverflow question you posted is a little bit dated. – Backo Aug 07 '11 at 08:36
  • oops, sorry about that. see [here](http://stackoverflow.com/questions/5858189/rails-3-display-validation-errors-for-a-form-not-saving-an-activerecord-model) – schiza Aug 07 '11 at 08:40
  • also, you can create a model, without a migration, and in controller in `create` don't invoke `save` but `valid`. it will perform validations, but don't save the model – schiza Aug 07 '11 at 09:11
0

You can use Contact Us gem via this link: https://github.com/JDutil/contact_us The documentation is clear and you can use it simply.

As I know by using it, it doesn't need any additional dependency like "formtastic".

Features:

  • Validation
  • Easy/Add remove fields
  • Simple configuration
Aboozar Rajabi
  • 1,683
  • 21
  • 26