diff --git a/app/models/ability.rb b/app/models/ability.rb
index 8523ae9..975bfa9 100644
--- a/app/models/ability.rb
+++ b/app/models/ability.rb
@@ -6,7 +6,7 @@ class Ability
if user.admin?
can :manage, :all
else
- can :read, User, :id => user.id
+ can :read, User
can :read, Card, :user_id => user.id
end
end
diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb
index f69137d..ed38bc9 100644
--- a/app/views/users/_form.html.erb
+++ b/app/views/users/_form.html.erb
@@ -21,11 +21,11 @@
<%= f.label :waiver %>
- <%= f.date_select :waiver %>
+ <%= f.date_select :waiver, :include_blank => 'true', :default => 'nil' %>
<%= f.label :orientation %>
- <%= f.date_select :orientation %>
+ <%= f.date_select :orientation, :include_blank => 'true', :default => 'nil' %>
<%= f.label :emergency_name %>
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb
index 2fb4353..2273fa8 100644
--- a/app/views/users/index.html.erb
+++ b/app/views/users/index.html.erb
@@ -7,7 +7,9 @@
Name |
Email |
- Cards |
+ <% if current_user.admin? then %>
+ Cards |
+ <% end %>
Active? |
Waiver? |
Admin? |
@@ -20,11 +22,11 @@
<%= user.name %> |
<%= user.email %> |
-
+ <% if current_user.admin? then %> |
<% user.cards.each do |c| %>
<%= link_to c.card_number, card_url(c) %><%= "," unless c == user.cards.last %>
<% end %>
- |
+ <% end %>
<%= if user.active? then "Active" end %> |
<%= if user.waiver.blank? then "Not Signed" else "Signed" end %> |
<%= if user.admin? then "Admin" end %> |