Fine tuned abilities and updated how membership is tracked

This commit is contained in:
2013-01-25 06:01:02 -07:00
parent 6e77b2bf68
commit 653fcc3112
25 changed files with 158 additions and 87 deletions

View File

@@ -1,7 +1,7 @@
<%= form_for(@user_certification) do |f| %>
<% if @user_certification.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@user_certification.errors.count, "error") %> prohibited this user_certification from being saved:</h2>
<h2><%= pluralize(@user_certification.errors.count, "error") %> prohibited this User Certification from being saved:</h2>
<ul>
<% @user_certification.errors.full_messages.each do |msg| %>
@@ -12,12 +12,12 @@
<% end %>
<div class="field">
<%= f.label :user_id %><br />
<%= f.number_field :user_id %>
<%= f.label :user_id, "User" %><br />
<%= collection_select(:user_certification, :user_id, @users, :id, :name) %>
</div>
<div class="field">
<%= f.label :certification_id %><br />
<%= f.number_field :certification_id %>
<%= f.label :certification_id, "Certification" %><br />
<%= collection_select(:user_certification, :certification_id, @certifications, :id, :name) %>
</div>
<div class="actions">
<%= f.submit %>

View File

@@ -1,4 +1,4 @@
<h1>Editing user_certification</h1>
<h1>Editing User Certification</h1>
<%= render 'form' %>

View File

@@ -1,25 +1,18 @@
<h1>Listing user_certifications</h1>
<h1>Listing User Certifications</h1>
<table>
<tr>
<th>User</th>
<th>Certification</th>
<th></th>
<th></th>
<th></th>
</tr>
<% @user_certifications.each do |user_certification| %>
<tr>
<td><%= user_certification.user_id %></td>
<td><%= user_certification.certification_id %></td>
<td><%= link_to 'Show', user_certification %></td>
<td><%= link_to 'Edit', edit_user_certification_path(user_certification) %></td>
<td><%= link_to 'Destroy', user_certification, :confirm => 'Are you sure?', :method => :delete %></td>
</tr>
<dl>
<% @grouped_user_certs.sort.each do |user, user_certifications| %>
<dt><%= user %></dt>
<% user_certifications.each do |user_certification| %>
<dd>
<%= link_to user_certification.certification.name, user_certification %> |
<%= link_to 'Edit', edit_user_certification_path(user_certification) %> |
<%= link_to 'Destroy', user_certification, :confirm => 'Are you sure?', :method => :delete %>
</dd>
<% end %>
<% end %>
</table>
</dl>
<br />
<%= link_to 'New User certification', new_user_certification_path %>
<%= link_to 'New User Certification', new_user_certification_path %>

View File

@@ -1,4 +1,4 @@
<h1>New user_certification</h1>
<h1>New User Certification</h1>
<%= render 'form' %>

View File

@@ -1,11 +1,11 @@
<p>
<b>User:</b>
<%= @user_certification.user_id %>
<%= @user_certification.user.name %>
</p>
<p>
<b>Certification:</b>
<%= @user_certification.certification_id %>
<%= @user_certification.certification.name %>
</p>