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
|
# Load users and certs based on current ability
|
||||||
before_filter :only => [:new, :edit, :create, :update] do
|
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)
|
@certifications = Certification.accessible_by(current_ability).sort_by(&:name)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -8,13 +8,10 @@
|
||||||
<%= simple_format @certification.description %>
|
<%= simple_format @certification.description %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
<b>Certified Users:</b>
|
<b>Certified Users:</b>
|
||||||
<ul>
|
<%= link_to "Click Here", user_certifications_path %>
|
||||||
<% @certification_users.each do |user| %>
|
</p>
|
||||||
<li><%= link_to user.name, user %></li>
|
|
||||||
<% end %>
|
|
||||||
<% if @certification_users.blank? then %><li>n/a</li><% end %>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<% if can? :update, @certification %><%= link_to 'Edit', edit_certification_path(@certification) %> |<% end %>
|
<% if can? :update, @certification %><%= link_to 'Edit', edit_certification_path(@certification) %> |<% end %>
|
||||||
<%= link_to 'Back', certifications_path %>
|
<%= link_to 'Back', certifications_path %>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<p>
|
<p>
|
||||||
<b>User:</b>
|
<b>User:</b>
|
||||||
<%= @user_certification.user.name %>
|
<%= link_to @user_certification.user.name, @user_certification.user %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user