Module: Draper::CanCan::InstanceMethods
- Defined in:
- lib/draper/cancan.rb
Instance Method Summary collapse
- #able_to?(action, *args) ⇒ Boolean
- #creatable? ⇒ Boolean
- #destroyable? ⇒ Boolean (also: #deletable?)
- #editable? ⇒ Boolean
- #managable? ⇒ Boolean
- #readable? ⇒ Boolean
- #unable_to?(action, *args) ⇒ Boolean
- #updatable? ⇒ Boolean
Instance Method Details
#able_to?(action, *args) ⇒ Boolean
27 28 29 |
# File 'lib/draper/cancan.rb', line 27 def able_to?(action, *args) h.can?(action, model, *args) end |
#creatable? ⇒ Boolean
4 5 6 |
# File 'lib/draper/cancan.rb', line 4 def creatable? able_to?(:create) end |
#destroyable? ⇒ Boolean Also known as: deletable?
22 23 24 |
# File 'lib/draper/cancan.rb', line 22 def destroyable? able_to?(:destroy) end |
#editable? ⇒ Boolean
11 12 13 |
# File 'lib/draper/cancan.rb', line 11 def editable? able_to?(:edit) end |
#managable? ⇒ Boolean
15 16 17 |
# File 'lib/draper/cancan.rb', line 15 def managable? able_to?(:manage) end |
#readable? ⇒ Boolean
18 19 20 |
# File 'lib/draper/cancan.rb', line 18 def readable? able_to?(:read) end |
#unable_to?(action, *args) ⇒ Boolean
30 31 32 |
# File 'lib/draper/cancan.rb', line 30 def unable_to?(action, *args) h.cannot?(action, model, *args) end |
#updatable? ⇒ Boolean
8 9 10 |
# File 'lib/draper/cancan.rb', line 8 def updatable? able_to?(:update) end |