I have a rail app setup with devise and i am now adding cancan.
The problem i am having is that where ever i have can? in my views, it
adds
a number. It only does this if the user does have the permission for the
action. Everything else is working perfectly, it’s just these annoying
numbers!
The club model and controller are just default as the scaffold
generated,
except i have a habtm with roles.
@clubs.each do |club|
%tr
%td= club.name
%td= link_to ‘Show’, club
= if can? :update, club
%td= link_to ‘Edit’, edit_club_path(club)
= if can? :destroy, club
%td= link_to ‘Destroy’, club, :confirm => ‘Are you sure?’, :method
=>
:delete
Would generate the following if the user is an admin