Listing activities

<% @activities.each do |activity| %> <% if activity.comment_url.present? %> <% else %> <% end %> <% end %>
Title Categories Neighborhood Address Price Dates Comment url Related
<%= activity.url.present? ? link_to(activity.title, activity.url) : activity.title %> <%= activity.activity_categories.map(&:name).join(', ') %> <%= activity.neighborhood %> <%= activity.address.present? ? activity.address.for_geocoder : "no address for #{activity.id}" %> <%= activity.price %> <%= activity.dates %><%= link_to('Comment here', activity.comment_url) + (activity.user.present? ? " by #{activity.user}" : '') %><%= activity.related %> <%= link_to 'Show', activity %> <%= link_to 'Edit', edit_activity_path(activity) %> <%= link_to 'Destroy', activity, method: :delete, data: { confirm: 'Are you sure?' } %>

<%= link_to 'New Activity', new_activity_path %>