Sha256: e42bae5856ca68964479723180d2fe11df6670791ad7dd3741f9b17e7ba0ecd7

Contents?: true

Size: 889 Bytes

Versions: 7

Compression:

Stored size: 889 Bytes

Contents

<div class="span-10">
<h1>Event</h1>

<%= render :partial => 'event_details', :object => @event %>

<h3>Attendees/Participants</h3>

<% 
#if @event.attendees.empty? 
%>
  <p><em>No attendees for this event.</em></p>
<% 
#else
 %>
    
  form stub

  <% @event.participants.group_by(&:class).map do |type, participants| %>
    <h4><%= link_to(pluralize(participants.size, type.to_s), polymorphic_path(type)) %></h4>
    <ol>
    <% participants.each do |participant| %>
      <% name_attr = participant.attribute_names.detect{|m_attr| m_attr =~ /name/} %>
      <% if participant.respond_to?(:name) %>
      <li><%= link_to(participant.send(name_attr), polymorphic_path(participant)) %></li>
      <% elsif name_attr %>
      <li><%= link_to(participant.name, polymorphic_path(participant)) %></li>
      <% end %>
    <% end %>
    </ol>
  <% end %>
  
  form stub end
<% 
#end
 %>
</div>

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
event_calendar_engine-0.1.7 app/views/events/show.html.erb
event_calendar_engine-0.1.6 app/views/events/show.html.erb
event_calendar_engine-0.1.5 app/views/events/show.html.erb
event_calendar_engine-0.1.4 app/views/events/show.html.erb
event_calendar_engine-0.1.3 app/views/events/show.html.erb
event_calendar_engine-0.1.2 app/views/events/show.html.erb
event_calendar_engine-0.1.1 app/views/events/show.html.erb