De-duplicating cert view

This commit is contained in:
Will Bradley 2013-08-26 22:32:08 -07:00
parent ae031838dc
commit 810ff6b034
3 changed files with 6 additions and 9 deletions

View File

@ -6,7 +6,7 @@ class UserCertificationsController < ApplicationController
# Load users and certs based on current ability
before_filter :only => [:new, :edit, :create, :update] do
@users = User.where(:hidden => false).accessible_by(current_ability).sort_by(&:name)
@users = User.where(:hidden => [false,nil]).accessible_by(current_ability).sort_by(&:name)
@certifications = Certification.accessible_by(current_ability).sort_by(&:name)
end

View File

@ -8,13 +8,10 @@
<%= simple_format @certification.description %>
</p>
<b>Certified Users:</b>
<ul>
<% @certification_users.each do |user| %>
<li><%= link_to user.name, user %></li>
<% end %>
<% if @certification_users.blank? then %><li>n/a</li><% end %>
</ul>
<p>
<b>Certified Users:</b>
<%= link_to "Click Here", user_certifications_path %>
</p>
<% if can? :update, @certification %><%= link_to 'Edit', edit_certification_path(@certification) %> |<% end %>
<%= link_to 'Back', certifications_path %>

View File

@ -1,6 +1,6 @@
<p>
<b>User:</b>
<%= @user_certification.user.name %>
<%= link_to @user_certification.user.name, @user_certification.user %>
</p>
<p>