diff --git a/app/views/mailer/send_for_user_activities.html.erb b/app/views/mailer/send_for_user_activities.html.erb
index e1712a15d..3d53acd5a 100644
--- a/app/views/mailer/send_for_user_activities.html.erb
+++ b/app/views/mailer/send_for_user_activities.html.erb
@@ -39,7 +39,7 @@
<% end %>
- <% if !@bids.first.nil? %>
+ <% unless @bids.empty? %>
<%= l(:label_homework_overview) %>(<%= @bids.count %>)
<% unless @bids.first.nil?%>
@@ -48,20 +48,20 @@
▪
[
- <%= link_to truncate(bid.courses.first.name,length: 30,omission: '...'), course_url(bid.courses.first, :token => @token.value),
+ <%= link_to truncate(bid.course.name,length: 30,omission: '...'), course_url(bid.course, :token => @token.value),
:class=> "wmail_column",
:style=> " font-weight: bold; display:block; float:left; color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
]
- <%= link_to bid.author, user_activities_url(bid.author,:token => @token.value), :class => "wmail_name",
+ <%= link_to bid.user, user_activities_url(bid.user,:token => @token.value), :class => "wmail_name",
:style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<%= l(:label_course_homework) %>
- <%= link_to truncate(bid.name,length: 30,omission: '...'), course_for_bid_url(:id => bid.id,:token => @token.value),
+ <%= link_to truncate(bid.name,length: 30,omission: '...'), student_work_index_path(:homework => bid.id,:token => @token.value),
:class => 'wmail_info',
:style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%>
- <%= format_time(bid.created_on) %>
+ <%= format_time(bid.created_at) %>
<% end %>
<% end %>
diff --git a/app/views/mailer/send_for_user_activities.text.erb b/app/views/mailer/send_for_user_activities.text.erb
index 2a2382301..669aca3d1 100644
--- a/app/views/mailer/send_for_user_activities.text.erb
+++ b/app/views/mailer/send_for_user_activities.text.erb
@@ -27,27 +27,27 @@
<% end %>
<% end %>
- <% if !@bids.first.nil? %>
+ <% unless @bids.empty? %>
<%= l(:label_homework_overview) %><%= @bids.count %>
<% unless @bids.first.nil?%>
<% @bids.each do |bid| %>
▪
[
- <%= link_to truncate(bid.courses.first.name,length: 30,omission: '...'),course_url(bid.courses.first, :token => @token.value)
+ <%= link_to truncate(bid.course.name,length: 30,omission: '...'),course_url(bid.course, :token => @token.value)
%>
]
- <%= link_to bid.author, user_activities_url(bid.author,:token => @token.value)
+ <%= link_to bid.user, user_activities_url(bid.user,:token => @token.value)
%>
<%= l(:label_course_homework) %>
- <%= link_to truncate(bid.name,length: 30,omission: '...'), course_for_bid_url(bid,:token => @token.value)
+ <%= link_to truncate(bid.name, length: 30,omission: '...'), student_work_index_path(:homework => bid.id,:token => @token.value)
%>
- <%= format_time(bid.created_on) %>
+ <%= format_time(bid.created_at) %>
<% end %>
<% end %>