views:

83

answers:

1

Hey,

I am trying to use permitted_to to hide/show links but in one of my forms it is not appearing.

The form belongs to assignments but the actual edit function is for candidates.

<% if permitted_to? :edit, @candidate %>
<%= link_to 'Edit', edit_candidate_path(@candidate) %>
<% end %>

I can navigate to the page by url so i know its not a authorization issue.

any ideas ?

Thanks, Alex

A: 

Sorry, found this in the documentation!

<%= link_to 'Edit', edit_contact_path(contact) if permitted_to? :update, contact %>
Alex