Ensure views only link to those actions allowed for current user
This commit is contained in:
@@ -10,11 +10,11 @@ h1 = FileTemplate.model_name.human(count: 2)
|
||||
tbody
|
||||
- @file_templates.each do |file_template|
|
||||
tr
|
||||
td = link_to(file_template.name, file_template)
|
||||
td = link_to(file_template.file_type, file_type_path(file_template.file_type))
|
||||
td = link_to(t('shared.show'), file_template)
|
||||
td = link_to(t('shared.edit'), edit_file_template_path(file_template))
|
||||
td = link_to(t('shared.destroy'), file_template, data: {confirm: t('shared.confirm_destroy')}, method: :delete)
|
||||
td = link_to_if(policy(file_template).show?, file_template.name, file_template)
|
||||
td = link_to_if(policy(file_template.file_type).show?, file_template.file_type, file_type_path(file_template.file_type))
|
||||
td = link_to(t('shared.show'), file_template) if policy(file_template).show?
|
||||
td = link_to(t('shared.edit'), edit_file_template_path(file_template)) if policy(file_template).edit?
|
||||
td = link_to(t('shared.destroy'), file_template, data: {confirm: t('shared.confirm_destroy')}, method: :delete) if policy(file_template).destroy?
|
||||
|
||||
= render('shared/pagination', collection: @file_templates)
|
||||
p = render('shared/new_button', model: FileTemplate)
|
||||
|
Reference in New Issue
Block a user