Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

event tests pass

  • Loading branch information...
commit 9fb29a894406ab8723ccc45bbc95909bfbfcb2c4 1 parent 7a19970
@pbm authored
View
2  app/views/events/edit.html.erb
@@ -1,6 +1,6 @@
<h1>Editing event</h1>
-<% if admin? %>
+<% if can? :update, Event %>
<%= render 'form' %>
<%= link_to 'Show', @event %> |
View
6 app/views/events/index.html.erb
@@ -5,7 +5,7 @@
<th>Title</th>
<th>Date</th>
<th>Desc</th>
- <% if admin? %>
+ <% if can? :update, Event %>
<th></th>
<th></th>
<th></th>
@@ -17,7 +17,7 @@
<td><%= event.title %></td>
<td><%= l event.date, :format => :short %></td>
<td><%= event.desc %></td>
- <% if admin? %>
+ <% if can? :update, Event %>
<td><%= link_to 'Show', event %></td>
<td><%= link_to 'Edit', edit_event_path(event) %></td>
<td><%= link_to 'Destroy', event, :confirm => 'Are you sure?', :method => :delete %></td>
@@ -27,6 +27,6 @@
</table>
<br />
-<% if admin? %>
+<% if can? :update, Event %>
<%= link_to 'New Event', new_event_path %>
<% end %>
View
2  app/views/events/show.html.erb
@@ -15,7 +15,7 @@
<%= @event.desc %>
</p>
-<% if admin? %>
+<% if can? :update, Event %>
<%= link_to 'Edit', edit_event_path(@event) %> |
<%= link_to 'Back', events_path %>
<% end %>
Please sign in to comment.
Something went wrong with that request. Please try again.