De-duplicating cert view
This commit is contained in:
parent
ae031838dc
commit
810ff6b034
|
@ -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
|
||||
|
||||
|
|
|
@ -8,13 +8,10 @@
|
|||
<%= simple_format @certification.description %>
|
||||
</p>
|
||||
|
||||
<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>
|
||||
<%= 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 %>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<p>
|
||||
<b>User:</b>
|
||||
<%= @user_certification.user.name %>
|
||||
<%= link_to @user_certification.user.name, @user_certification.user %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
|
Loading…
Reference in New Issue
Block a user