ruby on rails - Should I create an MVC Model in this scenario? -


i have rails3.2 application, , use formtastic , client-side-validations gems.

i have user, tablereservation standard crud operations, validations work aforementioned gems.

:user              :has_many   :table_reservations :table_reservation :belongs_to :user 

now need add 'search' form user details on table_reservation takes in user.first_name, user.last_name , table_reservation.secret_token. need add validations prevent normal user submitting invalid form.

i wondering if should create tablereservationsearch model keep working formtastic, client_side_validations gems before. @ same time, feels creating model unnecessary since not stored in database. aain model need not inherit activerecord include activemodel::validations, etc. can write simple form , use jquery validations plugin or similar.

so confused when create model such purposes , when not to!

what best way of approaching subject?

i think looking nested field validation . please issue . may . , no need create model validating nested fields on form . , on validation code can add action too.


Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -