Pregunta

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

¿Fue útil?

Solución

Sorry, found this in the documentation!

<%= link_to 'Edit', edit_contact_path(contact) if permitted_to? :update, contact %>
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top