<%= comment.contact.nickname -%> says:

<%= sanitize comment.body, :tags => %w(p table tr td div b i ul ol li em span strong), :attributes => %w(id class style) %>

<%# comment.body %><%# I need to add an edit link with dynamic form %> <% unless current_user.nil? %> <% unless @loop.nil? %> <% if current_user.contact_id == comment.contact_id %> <%= link_to "Edit your comment", edit_loop_comment_path(@loop, comment) %> <%= button_to "delete", comment, :confirm => "Are you sure?", :method=>:delete, :class=>:destroy, :remote => true, :html => { :'data-type' => 'html', :id => 'delete_comment_button' } %> <% elsif current_user.admin_id == 1 %> <%= link_to "Edit your comment", edit_loop_comment_path(@loop, comment) %> <%= button_to "delete", comment, :confirm => "Are you sure?", :method=>:delete, :class=>:destroy, :remote => true, :html => { :'data-type' => 'html', :id => 'delete_comment_button' } %> <% end %> <% else %> <% @loop = Loop.find(params[:loop_id]) %> <% if current_user.contact_id == comment.contact_id %> <%= link_to "Edit your comment", edit_loop_comment_path(@loop, comment) %> <%= button_to "delete", comment, :confirm => "Are you sure?", :method=>:delete, :class=>:destroy, :remote => true, :html => { :'data-type' => 'html', :id => 'delete_comment_button' } %> <% elsif current_user.admin_id == 1 %> <%= link_to "Edit your comment", edit_loop_comment_path(@loop, comment) %> <%= button_to "delete", comment, :confirm => "Are you sure?", :method=>:delete, :class=>:destroy, :remote => true, :html => { :'data-type' => 'html', :id => 'delete_comment_button' } %> <% end %> <% end %> <% end %>