Answer the question
In order to leave comments, you need to log in
How to validate form fields without a model?
But since there is no model, I don't even know how to implement it.
Here is the controller code:
class ZamsController < ApplicationController
def index
@clue = params[:name] + "." + params[:city] + "." + params[:phone1] + "." + params[:email]
ZamsMailer.zayavka(@clue).deliver
redirect_to root_path, success: 'Request sent successfully!'
end
end
Is there any other way to implement validation?
Answer the question
In order to leave comments, you need to log in
Read about the FormObject pattern
https://robots.thoughtbot.com/activemodel-form-objects
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question