Forum: Ruby on Rails Incorrect number of arguments.

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.
Jeff J. (Guest)
on 2006-01-19 16:51
Hello all. I have the following code in a partial. It's purpose is to
create a dropdown box with a bunch of values in it for display purposes

(@bugsheet is an instance variable being used by the partial)

<%= select("bugclientlink", "bug_id",

Given the fact that Bugclientlink class contains:

def self.listclients( reference )
    result = Bugclientlink.find_by_sql["select client_ref from
bugclientlink         where bug_id = ?", reference ]
    result.push('99999', '                 '))

Can anyone tell me why is it giving me the following error?

Many thanks in advance, I am sure it is something simple I am missing
(The joys of being a nub!)



Showing app/views/bugsheet/_display.rhtml where line #31 raised:

wrong number of arguments (0 for 1)

Extracted source (around line #31):

28:   </div>
29:   <div class="row">
30:     <span class="label"><label for="bugsheet_bs_formname">Reported
31:     <span class="first"><%=  select("bugclientlink", "bug_id",
Bugclientlink.listclients( %></span>
32:   </div>
33:     <div class="row">
34:     <span class="label"><label for="bugsheet_bs_assign">Team

Trace of template inclusion: /app/views/bugsheet/show.rhtml

RAILS_ROOT: ./script/../config/..
Application Trace | Framework Trace | Full Trace

#{RAILS_ROOT}/app/models/bugclientlink.rb:5:in `find_by_sql'
#{RAILS_ROOT}/app/models/bugclientlink.rb:5:in `listclients'
-e:3:in `load'
This topic is locked and can not be replied to.