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,problem)
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 !@problem.problem_urgency_id==nil?%>
Priority : <%=h ProblemPriority.find(@problem.problem_priority_id).name if !@problem.problem_priority_id==nil?%>
I have heard about collection but not yet used.What I am asking is that in the above Urgency and priority from the view the db is queried directly..So can i avoid this and pass the data as collections (I dont know I am right) from controller and access it in view so that avoid direct querying of datbase from view ? Or if I conntinue with the above is it wrong?
Thanks in advance Sijo