Saturday, July 30, 2011

[Rails] Re: Actionmailer Help Needed

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| %>
<li> <%= task.title %> </li>
<% 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

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate