class Client has_many :placements
class Placement belongs_to :clients
class Client...
def current_client
if Placement.find(:first,
:conditions => ["discharge_date IS NULL AND accepted IS true \
AND client_id = ?", self])
return true
else
return false
end
end
using paginator gem...in my clients_controller.rb
@pager = ::Paginator.new(Client.count(
:conditions => cond.to_sql), 12) do |offset, per_page|
Client.find(:all, :limit => per_page,
:conditions => cond.to_sql,
:include => :case_manager,
:order => sortby,
:offset => offset)
end
is there any way that I can ''sort'' by current_client (not a
table field)
and paginate properly?
Craig
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---