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|
%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
But would generate the following if they are a guest
Why is cancan leaving 2’s in my views?
Has anyone else had this problem?
Where would i even begin to troubleshoot this?