Simple CanCan problem
- by sscirrus
I have just started with CanCan and here's a sample of the code:
# Ability.rb
def initialize(user)
user ||= User.new
can :read, Link
end
# view.html.erb
<% if can? :read, @link %>
...
<% end %>
This is from the github repo for CanCan but this doesn't seem to work (it returns false and stops the ... code from running).
When I change the view to <% if can? :read, Link %>, it works. But, this is different to the CanCan readme. Do you know where I'm going wrong here?