문제

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

도움이 되었습니까?

해결책

Sorry, found this in the documentation!

<%= link_to 'Edit', edit_contact_path(contact) if permitted_to? :update, contact %>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top