Forum: Ruby on Rails text_field_with_auto_complete - NoMethodError in the model

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.
Jin Lee (Guest)
on 2006-04-27 22:56
(Received via mailing list)
Hey guys,

I have a text_field_with_auto_complete that looks like this:

<%= text_field_with_auto_complete ("service_request", "req_name",
{"size"=>40}) %>

which goes to this in the controller:

def auto_complete_for_service_request_req_name

auto_complete_responder_for_investigators renders the partial after
doing a query.

When I load the page, I get this:

NoMethodError in   Service_request#new

Showing app/views/service_request/new.rhtml where line #12 raised:
undefined method `req_name' for #<ServiceRequest:0x7802a50>

that's because req_name is not a field in the table. So in my
ServiceRequest.rb model, I have this:

validates_presence_of :req_name

Still not working... am I missing something here? Any help is

This topic is locked and can not be replied to.