From 810ff6b034836afc8da96a2b1539c92cf4068421 Mon Sep 17 00:00:00 2001
From: Will Bradley
Date: Mon, 26 Aug 2013 22:32:08 -0700
Subject: [PATCH] De-duplicating cert view
---
app/controllers/user_certifications_controller.rb | 2 +-
app/views/certifications/show.html.erb | 11 ++++-------
app/views/user_certifications/show.html.erb | 2 +-
3 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/app/controllers/user_certifications_controller.rb b/app/controllers/user_certifications_controller.rb
index 6d222ee..aff149a 100644
--- a/app/controllers/user_certifications_controller.rb
+++ b/app/controllers/user_certifications_controller.rb
@@ -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
diff --git a/app/views/certifications/show.html.erb b/app/views/certifications/show.html.erb
index 272deae..c9fce2b 100644
--- a/app/views/certifications/show.html.erb
+++ b/app/views/certifications/show.html.erb
@@ -8,13 +8,10 @@
<%= simple_format @certification.description %>
-Certified Users:
-
- <% @certification_users.each do |user| %>
- - <%= link_to user.name, user %>
- <% end %>
- <% if @certification_users.blank? then %>- n/a
<% end %>
-
+
+ Certified Users:
+ <%= link_to "Click Here", user_certifications_path %>
+
<% if can? :update, @certification %><%= link_to 'Edit', edit_certification_path(@certification) %> |<% end %>
<%= link_to 'Back', certifications_path %>
diff --git a/app/views/user_certifications/show.html.erb b/app/views/user_certifications/show.html.erb
index d12c3be..66b4b5f 100644
--- a/app/views/user_certifications/show.html.erb
+++ b/app/views/user_certifications/show.html.erb
@@ -1,6 +1,6 @@
User:
- <%= @user_certification.user.name %>
+ <%= link_to @user_certification.user.name, @user_certification.user %>