Undefined method error

Hi
I have controoler code as
@sd_activities=ServiceDeskActivity.find_all_by_service_desk_ticket_id(service_desk_ticket.id).display_sd_activities(params[:page])

The in the model ServiceDeskActivity
def self.display_sd_activities(page)
paginate :per_page => 2, :page => page
end

But this creates the error
undefined method `display_sd_activities’ for #Array:0xb7416164

why this happens?

Sijo

On 21 May 2008, at 09:13, Sijo Kg wrote:

def self.display_sd_activities(page)
paginate :per_page => 2, :page => page
end

But this creates the error
undefined method `display_sd_activities’ for #Array:0xb7416164

because you’ve got an array and you’re calling a method from
ServiceDeskActivity on it. (you may have thought this would work
because with an association proxy (ie
some_object.service_desk_activities.display_sd_activities ) it would
work)

Fred

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs