Re: Actionmailer Help Needed

Jenny Blunt
Sat, 30 Jul 2011 11:28:00 -0000

Ok, I''m nearly there.

Have figured out how to get actionmailer to email those users with tasks
due. That was ok after I got my head around it.

I can get the email view to list ALL tasks but not just those owned by a
user. In my view, I''ve tried this:

<% Task.tasksdue.find_each do |task| %>
<%= task.title %>
<% end %>

Which calls a scope from my Task model.

 scope :tasksdue, lambda {
     where("dueddate >= ? AND user_id = ? AND status = ?",
Date.today,
:user_id, false)
  }

But I don''t get any data out of that. If I get rid of the user_id
aspect, it lists all tasks.

How can I adjust that so it works?

Thanks

Jx