S
Sijo Kg
Hi
This is more ruby related that is why I am asking here
I have controller code as
@sd_activities=ServiceDeskActivity.find_all_by_service_desk_ticket_id(service_desk_ticket.id).display_sd_activities(params[age])
and in model ServiceDeskActivity
def self.sd_activities_paginate(page)
paginate er_page => 2, age => page
end
But this gave me an error
undefined method `display_sd_activities' for #<Array:0xb7416164>
And if it were
@sd_activities=ServiceDeskActivity.find_all_by_service_desk_ticket_id(service_desk_ticket.id).paginate
er_page => 2, age => page
or
@sd_activities=service_desk_ticket.service_desk_activities.paginate
er_page => 2, age => page
Then no error happens And it working properly
But
@sd_activities=service_desk_ticket.service_desk_activities
puts @sd_activities.class
@sd_activities=ServiceDeskActivity.find_all_by_service_desk_ticket_id(service_desk_ticket.id)
puts @sd_activities.class
Here both gives Array.The why the first working and second not?
Thanks in advance
Sijo
This is more ruby related that is why I am asking here
I have controller code as
@sd_activities=ServiceDeskActivity.find_all_by_service_desk_ticket_id(service_desk_ticket.id).display_sd_activities(params[age])
and in model ServiceDeskActivity
def self.sd_activities_paginate(page)
paginate er_page => 2, age => page
end
But this gave me an error
undefined method `display_sd_activities' for #<Array:0xb7416164>
And if it were
@sd_activities=ServiceDeskActivity.find_all_by_service_desk_ticket_id(service_desk_ticket.id).paginate
er_page => 2, age => page
or
@sd_activities=service_desk_ticket.service_desk_activities.paginate
er_page => 2, age => page
Then no error happens And it working properly
But
@sd_activities=service_desk_ticket.service_desk_activities
puts @sd_activities.class
@sd_activities=ServiceDeskActivity.find_all_by_service_desk_ticket_id(service_desk_ticket.id)
puts @sd_activities.class
Here both gives Array.The why the first working and second not?
Thanks in advance
Sijo