Sha256: 8d5a90a1780584fba643d4472c298e444c55f5818acb24333c7f96fa06e5a8ae

Contents?: true

Size: 1.18 KB

Versions: 1

Compression:

Stored size: 1.18 KB

Contents

<h1><%= @conversation.subject %></h1>

<div>
  <h4>From: <%= @user.name %></h4>
  <h4>To:</h4>
  <ul>
    <%# TODO: move method into model %>
    <% for user in @conversation.users.reject! { |u| u == @user } do %>
      <li><%= link_to user.name, user %></li>
    <% end %>
  </ul>
</div>

<% for message in @conversation.messages do %>
  <div class="message"><%= time_ago_in_words(message.created_at) %> ago, <%= message.user.name %> wrote:
    <div class="message_body"><%= message.body %></div>
  </div>
<% end %>

<%= form_for(@message, :url => user_conversation_messages_path(@conversation.user, @conversation)) do |f| %>
  <div>
    <%= f.label :body %><br />
    <%= f.text_area :body %>
  </div>
  <%= f.submit %>
<% end %>

<% if current_user == @conversation.user && !@conversation.read? %>
  <%= link_to "Mark as read", mark_as_read_user_conversation_path(@conversation.user, @conversation), :method => :post %>
<% elsif current_user == @conversation.user && @conversation.read? %>
  <%= link_to "Mark as unread", mark_as_unread_user_conversation_path(@conversation.user, @conversation), :method => :post %>
<% end %>
<br />

<%= link_to "Back to conversations", user_conversations_path(@user) %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
conversations-0.0.1 app/views/conversations/user_conversations/show.html.erb