Closed TeuF closed 14 years ago
TeuF,
Can you be more specific?
jack
Ooohh just found it, sorry
And I tried this in my view:
<% if can?(:create, Comment) %> .... <% end %>
instead of
<% if can?(:create, @commentable.comments) %> .... <% end %>
Thanks
Did that work for you? If you setup permissions in your app/models/ability.rb for who can and cannot create a Comment you should be ok. I'm not sure exactly what the question is here...
Yes that's the question. But no it's still not working. Have you already used acts_as_commentable with cancan ? I want to restrict the creation of comments to some users.
TeuF,
There's nothing about acts_as_commentable that should prevent you from using it with CanCan.
As long as you have a "can :create, Comment" in your ability.rb, and maybe some code making sure the user in Ability matches the user on a specific comment for :update purposes, you should be good. I'd read up more on CanCan if that doesn't quite make sense.
Hi,
Someone know how to use cancan with acts_as_commentable ?
Thanks,