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
football Show Edit 2 Destroy 2But would generate the following if they are a guest
football ShowWhy is cancan leaving 2’s in my views?
Has anyone else had this problem?
Where would i even begin to troubleshoot this?
ruby 1.9.3
rails 3.2.2
cancan 1.6.7
devise 2.0.4
Thank you,
scott