<% @logs.each_with_index do |log, i| %>
Author :
<% user = User.find(log.create_user_id) %>
<%= user.member_profile.nil? ? user.user_name : user.member_profile.name %>
Date :
<%= log.created_at %>
<% if !log.update_user_id.nil? %>
Updated by :
<% user = User.find(log.update_user_id) %>
<%= user.member_profile.nil? ? user.user_name : user.member_profile.name %>
<% end %>
Title :
<%= log.title %>
<% if !log.site_log_files.blank? %>
<% log.site_log_files.each_with_index do |file,index| %>
<%= index == 0 ? "Files" : "" %>
<%= link_to (file.title.nil? || file.title == "" ? file.file_identifier : file.title), file.file.url, {:class => 'file-link file-type', :target => '_blank', :title => file.file_identifier} %>
<% end %>
<% end %>
Content :
<%= log.content.html_safe %>
Edit
<% if i != (@logs.length - 1) %>
<% end %> <% end %>