Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <% if can? :update, @article %>
- <%= link_to "Edit", edit_article_path(@article) %>
- <% end %>
- user.can?(:update, @article)
- class User < ActiveRecord::Base
- def ability
- @ability ||= Ability.new(self)
- end
- delegate :can?, :cannot?, :to => :ability
- end
- user.can?(:update,@article)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement