Forum: Ruby on Rails Search form validation

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
spurthi gunadhar (Guest)
on 2014-01-27 15:47
(Received via mailing list)
Hello everybody!

I am new to Ruby on rails and so my doubt would be very trivial for the
most of you. But, since I do not know to tackle the problem, I would
to ask you.

I have a search method defined in my model. I need to add validations to
the search method.

Should I add a javascript function in my index.html or can I validate
method in the model itself?

Note : My search method does not have a model of its own. It is defined
another model.

Please help me on this issue.

Any suggestion would be appreciated.

Thanks in advance!
F3ce6b38fab69a0a8ba9226bc0b407d5?d=identicon&s=25 Walter D. (walterdavis)
on 2014-01-27 15:50
(Received via mailing list)
On Jan 27, 2014, at 9:41 AM, spurthi gunadhar wrote:

> Please help me on this issue.
> Any suggestion would be appreciated.

What sort of validations are you looking to add here? What search
technique are you using, and do you need to protect people from getting
no results if they put garbage in?

Yong Gu (Guest)
on 2014-01-27 15:51
(Received via mailing list)

I think you can try sing Form Object, see
This topic is locked and can not be replied to.