On 21 May 2008, at 09:13, Sijo Kg wrote:
>
> 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>
>
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
> why this happens?
>
> Sijo
> --
> Posted via http://www.ruby-forum.com/.
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---