Use index? to validate permissions of classes instead of show? for obj.

This commit is contained in:
Sebastian Serth
2019-01-17 18:34:04 +01:00
parent 0b5ec1820d
commit ff8c1f6838

View File

@ -8,7 +8,7 @@
- if object
li.breadcrumb-item = object
- else
li.breadcrumb-item = link_to_if(policy(model).show?, model.model_name.human(count: 2), send(:"#{model.model_name.collection}_path"))
li.breadcrumb-item = link_to_if(policy(model).index?, model.model_name.human(count: 2), send(:"#{model.model_name.collection}_path"))
- if object
li.breadcrumb-item = link_to_if(policy(object).show?, object, send(:"#{model.model_name.singular}_path", object))
li.breadcrumb-item.active