V
V
Vladislav Sofienko2017-07-31 14:27:42
Ruby on Rails
Vladislav Sofienko, 2017-07-31 14:27:42

How to create mail contact form without working with database and controllers?

Hello. I was faced with the task of creating a regular contact form, where you need to specify a name, email, subject and the message itself. I googled and also came across a question on stackoverflow .
The problem is that a database is screwed up for all this when a controller is created for the work of sending mail, but by and large I don’t need this. I just need to take the data from the form (name, mail, subject and the message itself) check for validity (the length of the name, message and that the fields are filled) and just send. I don't need to fix something in the database, let alone work with it.
How to solve it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Andreev, 2017-07-31
@sofvlad

FormObjects - https://robots.thoughtbot.com/activemodel-form-objects

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question