On Sep 8, 7:10 am, Sijo Kg <[EMAIL PROTECTED]> wrote:
> Hi
> I am calling the following from the problem controller
> @problem=Problem.find(params[:id])
> MailSendingProblem.send_mail_to_group_owner(group_id.to_i,@problem) and
> inside the def send_mail_to_group_owner
>
> ProblemMailer.deliver_to_send_mail_to_user(user.name,pemailaddress.email,pr
> oblem)
>
> Now in the view to_send_mail_to_user.rhtml I have
> Number : <%= @problem.number%>
> Title : <%= @problem.title%>
> Urgency : <%=h ProblemUrgency.find(@problem.problem_urgency_id).name
> if [EMAIL PROTECTED]>
>
> Priority : <%=h
> ProblemPriority.find(@problem.problem_priority_id).name if
> [EMAIL PROTECTED]>
>
Given the time you;ve been posting to this list you should really have
read about associations.
Give problem a problem_urgency (or even just urgency) association and
the lines above become things like
@problem.problem_urgency.name if @problem.problem_urgency
Not sure what collections have got to do with any of this.
Fred
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---