Validation without ActiveRecord

Carl Youngblood
Sat, 23 Jul 2005 06:06:32 -0000

Hello, I followed the instructions at

http://wiki.rubyonrails.com/rails/show/HowToUseValidationsWithoutExtendingActiveRecord

But now I''m having trouble trying to create my form view.
Here''s a
brief rundown of what I''ve done:

- Created a class called SearchRequest that extends ValidatingBase and
saved it in a file called search_request.rb and put it in my models
directory.
- Added a ''request'' method to my controller that instantiates
SearchRequest and calls the valid? method
- Created a view called request.rhtml and saved it into app/views/home.

Even though my SearchRequest class has an accessor called fullname, I
get a NoMethodError exception when I try to call

<%= text_field :request, ''fullname'' %>

It says:

undefined method `fullname'' for
#<ActionController::CgiRequest:0x24a6c14>

I''m assuming that my controller somehow has not figured out that I
want to use SearchRequest as my model.  I tried adding it as a model
to the controller but that didn''t fix this  problem.

Any advice would be greatly appreciated.

Thanks,
Carl