M
Matteo Corti
Hi,
I am developing a small application with rails. I'll try to summarize my
problem.
I have an HTML table displaying the content of a database table
I want to filter the rows of my table by display just a subset of them (as
an example let's say that every record has a numberic field called number
and that I want to display only the records with a number field lower than a
user supplied value).
For this reason I have a web form with a text field asking for the number.
My problem comes with the validation of the user input since the values of
this form (as the number in the example) are not related to any table in the
database and as I have seen all the validation methods are part of
ActiveRecord:Base.
Should I check every value manually or is there a way to validate a form
input when the form data is not related to a database table?
Many thanks,
Matteo
I am developing a small application with rails. I'll try to summarize my
problem.
I have an HTML table displaying the content of a database table
I want to filter the rows of my table by display just a subset of them (as
an example let's say that every record has a numberic field called number
and that I want to display only the records with a number field lower than a
user supplied value).
For this reason I have a web form with a text field asking for the number.
My problem comes with the validation of the user input since the values of
this form (as the number in the example) are not related to any table in the
database and as I have seen all the validation methods are part of
ActiveRecord:Base.
Should I check every value manually or is there a way to validate a form
input when the form data is not related to a database table?
Many thanks,
Matteo