Module: CanCanDry::AbilityMappingSets::ActiveScaffold
- Defined in:
- lib/can_can_dry/ability_mapping_sets/active_scaffold.rb
Constant Summary collapse
- ACTIVE_SCAFFOLD_MAPPING =
{ read: %i[browse index mark render_field show show_search], create: %i[create new], update: %i[add_existing edit edit_associated new_existing update update_column], destroy: %i[destroy destroy_existing] }.freeze
Instance Method Summary collapse
Instance Method Details
#map_active_scaffold(controller, entity) ⇒ Object
13 14 15 16 17 |
# File 'lib/can_can_dry/ability_mapping_sets/active_scaffold.rb', line 13 def map_active_scaffold(controller, entity) ACTIVE_SCAFFOLD_MAPPING.each do |can_action, actions| actions.each { |action| map_action controller, action.to_s, can_action, entity } end end |