diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index 01ecba3..f6f5245 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -38,7 +38,7 @@ Instructor: - <%= @course.user.name %> + <%= @course.user.name %>      <% if ((current_user.id!=@course.user.id) && (current_user.utype=="student")) %> <%= link_to 'Message me!', conversations_path(sender_id: current_user.id, receiver_id: @course.user.id), method: 'post'%> <%end %> diff --git a/app/views/messages/index.html.erb b/app/views/messages/index.html.erb index d161cb8..d494e64 100644 --- a/app/views/messages/index.html.erb +++ b/app/views/messages/index.html.erb @@ -2,7 +2,8 @@ <%= link_to 'Show Previous', '?m=all' %> -
+
+ <% @messages.each do |message| %> <% if message.body %> <% user = User.find(message.user_id) %> @@ -25,7 +26,9 @@ <% end %> <% end %> +
+
<%= form_for [@conversation, @message], html: {class: "ui reply form"} do |f| %> @@ -33,6 +36,7 @@ <%= f.text_area :body, class: "form-control" %>
<%= f.text_field :user_id, value: current_user.id, type: "hidden" %> + <%= f.text_field :read, value: false, type: "hidden" %>
<%= f.submit "Reply !", class: "btn btn-primary" %>
diff --git a/app/views/student_courses/enrolledshow.html.erb b/app/views/student_courses/enrolledshow.html.erb index a37b45b..c471550 100644 --- a/app/views/student_courses/enrolledshow.html.erb +++ b/app/views/student_courses/enrolledshow.html.erb @@ -14,7 +14,7 @@ <% @student_courses.each do |student_course| %> <% if student_course !=nil %> - <%= student_course.user.name %> + <%= student_course.user.name %>      <% if ((current_user.id!=student_course.user.id) && (current_user.utype=="instructor")) %> <%= link_to 'Message me!', conversations_path(sender_id: current_user.id, receiver_id: student_course.user.id), method: 'post'%> <%end %> diff --git a/app/views/student_courses/show.html.erb b/app/views/student_courses/show.html.erb index cf0e20d..855686d 100644 --- a/app/views/student_courses/show.html.erb +++ b/app/views/student_courses/show.html.erb @@ -19,7 +19,7 @@ Course instructor - <%= @student_course.course.user.name %> + <%= @student_course.course.user.name %>      <% if ((current_user.utype=="student")) %> <%= link_to 'Message me!', conversations_path(sender_id: current_user.id, receiver_id: @student_course.course.user.id), method: 'post'%> <%end%>