2 autocomplete fields


#1

I’ve got a problem with these ;]

The second one does not work, does not even request a controller method.
Acts like a usual field… What do I do wrong?

#view

<tr>
	<td class="required">Key Account Manager:</td>
	<td class="content">
		<%= text_field_with_auto_complete :user, :last_name, {}, :skip_style

=> true %>



Parent Account:

<%= text_field_with_auto_complete :account, :name, {}, :skip_style =>
true %>

#controller
def auto_complete_for_user_last_name
value = @params[:user][:last_name]
@users = User.find(:all,
:conditions => [ ‘LOWER(last_name) LIKE ?’,
‘%’ + value.downcase + ‘%’ ],
:order => ‘last_name ASC’,
:limit => 8)
render :partial => ‘users’
end

def auto_complete_for_account_name
value = @params[:account][:name]
@accounts = Account.find(:all,
:conditions => [ ‘LOWER(name) LIKE ?’,
‘%’ + value.downcase + ‘%’ ],
:order => ‘name ASC’,
:limit => 8)
render :partial => ‘accounts’
end