How do I specify a custom message based on a rule being invalidated in ability.rb?

7 views
Skip to first unread message

marcam...@gmail.com

unread,
Dec 12, 2016, 12:39:35 PM12/12/16
to cancancan
In my `ability.rb`, I have the following rule:

elsif user.has_role? :demo
can :read, Profile, demo_featured: true, demo_linked: true, message: "To access this profile, please subscribe here."

But that doesn't produce the message I want.

How do I get this specific rule to produce the message I want?

Reply all
Reply to author
Forward
0 new messages