Skip to content

Instantly share code, notes, and snippets.

@sirramongabriel
Created December 3, 2013 03:01
Show Gist options
  • Save sirramongabriel/7763245 to your computer and use it in GitHub Desktop.
Save sirramongabriel/7763245 to your computer and use it in GitHub Desktop.
<div>
<% if @teams.blank? %>
<h3><small>No Teams Exist</small></h3>
<%= render 'teams/first_object' %>
<% else %>
<%= link_to :back, universities_path %>
<h3><small>Teams fo <%= @university.name %></small></h3>
<br />
<div class="table-responsive">
<table class="table table-bordered" style="width: 50%;">
<thead>
<th>Name</th>
<th>Sport Type</th>
<th>View</th>
<th>Edit</th>
<th>Delete</th>
</thead>
<tbody>
<% @teams.each_with_index do |team, university| %>
<tr>
<td><%= team.id %></td>
<td><%= team.sport_type %></td>
<td>
<%= button_to :view,
university_team_path(university_id: @university, id: team),
options = {
method: :get,
class: 'btn btn-xs btn-info',
type: 'button'
} %>
</td>
<td>
<%= button_to :edit,
edit_university_team_path(
university_id: @university,
id: team
),
options = {
method: :get,
class: 'btn btn-xs btn-default',
style: 'display: inline;',
type: 'button'
} %>
</td>
<td>
<%= button_to :delete,
university_team_path(
university_id: @university,
id: team
),
options = {
confirm: 'You sure?',
method: :delete,
class: 'btn btn-xs btn-danger',
style: 'display: inline;'
} %>
</td>
</tr>
<% end %>
</tbody>
</table>
</div><!-- END class table-responsive -->
<div class="pull-left">
<span>
<%= button_to 'Create a Team', new_university_team_path(@university),
options = {
method: :get,
class: 'btn btn-lg btn-primary pull-right',
style: 'margin-bottom: 2%;'
} %>
<%= button_to 'Back to University', university_path(@university),
options = {
method: :get,
class: 'btn btn-sm btn-inverse'
} %>
</span>
</div>
<% end %>
</div><!-- END class container -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment