I have been using a scope to present some information to show todos that have been completed and are 24 hours old
scope :completed, joins(:user).where(:todos => { :complete => true })
scope :logged, completed.where("todos.updated_at <= ?", 1.day.ago)
Using the regular todo partial
<%= render @user.todos.logged =>
However I want to present those logged items in a different partial _logged.html.erb. I just can’t figure out the proper way to pass scope results to a specific partial.
Thanks
Well, if you want to render partial for each item, yo can do:
Or if you want to pass the whole array to one instance then you can do
In both cases I guess your object will be called
logged.Assuming that your partial contains
<%= logged.title %>you want to render for each item, so you can use the first version.